See other catalogues for
The MathWorks
You may also be interested in
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 | | |
| | | |
| | | | | | | | | | | | | | | |