08 Matrix Multiplication Instructionsl

08_matrix-matrix-multiplication_instructionsl

User Manual:

Open the PDF directly: View PDF PDF.
Page Count: 1

Matrix-Matrix Multiplication
We multiply two matrices by breaking it into several vector multiplications and
concatenating the result.
An m x n matrix multiplied by an n x o matrix results in an m x o matrix. In the
above example, a 3 x 2 matrix times a 2 x 2 matrix resulted in a 3 x 2 matrix.
To multiply two matrices, the number of columns of the first matrix must equal
the number of rows of the second matrix.
For example:
% Initialize a 3 by 2 matrix
A = [1, 2; 3, 4;5, 6]
% Initialize a 2 by 1 matrix
B = [1; 2]
% We expect a resulting matrix of (3 by 2)*(2 by 1) = (3 by 1)
mult_AB = A*B
% Make sure you understand why we got that result

Navigation menu