0% found this document useful (0 votes)
10 views9 pages

Lecture 4

Uploaded by

kkyu01
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views9 pages

Lecture 4

Uploaded by

kkyu01
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

ENE 2017

Engineering Programming
Prof. Keonwook Kim
Division of Electronics and Electrical Engineering
Dongguk University, Seoul, Korea

Ch.4 Matrices
MATLAB began as a matrix calculator.
Experiments with MATALB – Cleve Moler

Matrices
• The Cartesian coordinate system
• A pair of numbers corresponds to a point in the plane.
• Display the coordinates in a vector of length two.
• Column vector

Experiments with MATALB – Cleve Moler

Matrices
• 2-by-2 matrix

• Matrix-vector multiplication
Experiments with MATALB – Cleve Moler

Matrices
• An alternate

• The transpose of a column vector is a row vector

Experiments with MATALB – Cleve Moler

Matrices
• Matrix-matrix multiplication, AB
• AB is not the same matrix as BA
• MATLAB started its life as “Matrix Laboratory”
• We use square brackets instead of round parentheses, an
asterisk to denote multiplication, and x' for the transpose of x.
Experiments with MATALB – Cleve Moler

Matrices

• Identity matrix

eye(n)

Experiments with MATALB – Cleve Moler

2-by-2 matrix transformations


• The columns of X are the Cartesian coordinates of the 11
points

• Dot to dot game.


Dot2dot(X)
figure, scatter(X(1,:),X(2,:),'filled'), axis(10*[‐1 1 ‐1 1]), axis square
Experiments with MATALB – Cleve Moler

2-by-2 matrix transformations


10 10

8 8

6 6

4 4

2 2

0 0

-2 -2

-4 -4

-6 -6

-8 -8

-10 -10
-10 -5 0 5 10 -10 -5 0 5 10

Experiments with MATALB – Cleve Moler

2-by-2 matrix transformations


• Matrix transformation
wiggle(X)

dot2dot(A*X)
Experiments with MATALB – Cleve Moler

2-by-2 matrix transformations


• Determinant

• 2-by-2 determinants can be useful in understanding simple matrix


properties.
• If the determinant of a matrix is positive, then multiplication by that
matrix preserves left- or right-handedness.
• The last two matrices have negative determinants, so the door is
transformed to the other side of the house.

Experiments with MATALB – Cleve Moler

2-by-2 matrix transformations


• Random transformation

• If the determinant were exactly zero,


the house would be flattened to
a one-dimensional straight line.
Experiments with MATALB – Cleve Moler

2-by-2 matrix transformations


• Plane rotation

Experiments with MATALB – Cleve Moler

2-by-2 matrix transformations


Experiments with MATALB – Cleve Moler

Vectors and matrices


• Vectors are created with square brackets.
• Rows of a matrix are separated by semicolons.
• Several functions

Experiments with MATALB – Cleve Moler

Vectors and matrices


• Colon creates uniformly spaced vectors
• Semicolon at the end of a line suppresses output
Experiments with MATALB – Cleve Moler

Matrix arithmetic
• Matrix addition and subtraction are denoted by + and –
• Require A and B to be the same size, or to be scalars, which are 1-
by-1 matrices.
A+B A‐B
• Matrix multiplication, denoted by *, follows the rules of linear
algebra.

• Matrix division operations (see linear equation chapter)

Experiments with MATALB – Cleve Moler

Array arithmetic
• Matrices, which behave according to the rules of linear
algebra, and arrays, which are just rectangular collections of
numbers.
• Element-by-element operations array operations are denoted
by + , - , .* , ./ , . and .^ .
• For array multiplication A.*B is equal to B.*A

You might also like