![]()
MATH347 L3: Matrix operations
|
New concepts:
Matrix addition and scaling
Matrix multiplication
Matrix addition properties
Matrix multiplication properties
![]()
Matrix addition
|
Definition. The sum of matrices
is the matrix with components
>> |
A=[1 0 1; 2 -1 3]; B=[2 1 -1; 1 1 -1]; C=A+B; disp(A) |
1 0 1
2 -1 3
>> |
disp(B) |
2 1 -1
1 1 -1
>> |
A+B |
![]()
Matrix scaling
|
Definition. The scalar multiplication of matrix by is
>> |
A=[1 0 1; 2 -1 3]; disp(A) |
1 0 1
2 -1 3
>> |
2*A |
>> |
A+A |
>> |
![]()
Matrix multiplication
|
Definition. Consider matrices , and The matrix product is a matrix with column vectors given by the matrix vector products
A matrix-matrix product is simply a set of matrix-vector products, and hence expresses multiple linear combinations in a concise way.
The dimensions of the matrices must be compatible, the number of rows of must equal the number of columns of .
A matrix-vector product is a special case of a matrix-matrix product when .
We often write in terms of columns as
![]()
Matrix multiplication example
|
>> |
A=[1 0 3; 2 1 4; -1 0 3]; disp(A) |
1 0 3
2 1 4
-1 0 3
>> |
X=[1 -1 0; 1 1 1; 0 1 0]; disp(X) |
1 -1 0
1 1 1
0 1 0
>> |
A*X |
>> |
[A*X(:,1) A*X(:,2) A*X(:,3)] |
![]()
Matrix multiplication: componentwise
|
Definition. Consider matrices , and The matrix product is a matrix with components
![]()
Matrix multiplication example revisited
|
>> |
A=[1 0 3; 2 1 4; -1 0 3]; disp(A) |
1 0 3
2 1 4
-1 0 3
>> |
X=[1 -1 0; 1 1 1; 0 1 0]; disp(X) |
1 -1 0
1 1 1
0 1 0
>> |
A*X |
>> |
dot(A(1,:),X(:,2)) |
>> |
dot(A(3,:),X(:,1)) |
![]()
Matrix addition properties compared to real numbers
|
,
Associativity: ,
Zero element: ,
Opposite: ,
Commutativity: ,
![]()
Matrix multiplication properties compared to real numbers
|
,
Associativity: ,
Unity element: , ( is the identity matrix)
Inverse: , , Would like , but need to establish conditions for existence of (analogous to )
Commutativity: . In general need not be equal to .
![]()
Dot product as matrix multiplication
|
Dot product of : is a matrix multiplication
The above form is useful in many cases, e.g., proving the cosine theorem
Cosine theorem: , , with ,,.
,