Mathematics - The MathWorks - #20

/ 316


catalogue search
P. 01
P. 02
P. 03
P. 04
P. 05
P. 06
P. 07
P. 08
P. 09
P. 10
P. 11
P. 12
P. 13
P. 14
P. 15
P. 16
P. 17
P. 18
P. 19
P. 20
P. 21
P. 22
P. 23
P. 24
P. 25
P. 26
P. 27
P. 28
P. 29
P. 30
P. 31
P. 32
P. 33
P. 34
P. 35
P. 36
P. 37
P. 38
P. 39
P. 40
P. 41
P. 42
P. 43
P. 44
P. 45
P. 46
P. 47
P. 48
P. 49
P. 50


See other catalogues for The MathWorks

Text version of the page
1 Linear Algebra
Multiplying Matrices
Multiplication of matrices is defined in a way that reflects composition of the underlying linear transformations and allows compact representation of systems of simultaneous linear equations. The matrix product C=AB is defined when the column dimension of A is equal to the row dimension of B, or when one of them is a scalar. If A is m-by-p and B is p-by-n, their product C is m-by-n.The product can actually be defined using MATLAB for loops, colon notation, and vector dot products:
A = pascal(3); B = magic(3); m= 3; n= 3; for i = 1:m
for j = 1:n
C(i,j) = A(i,:)*B(:,j);
end
end
MATLAB uses a singleasterisktodenotematrixmultiplication. Thenexttwo examples illustrate the fact that matrix multiplication is not commutative; AB is usually not equal to BA:
X = A*B
X=
15
15
15
26
38
26
41
70
39
B*A
15
28
47
15
34
60
15
28
43
Y =
Y =
A matrix can be multiplied on the right by a column vector and on the left by a row vector:
u= [3; 1;4];
1-10

pageCatalog pdf di En 2012-06-22-01