Read · 1 min
Unlike adding and subtracting matrices, when we multiply matrices, we don't just multiply the corresponding values. When multiplying matrices, we have to multiply each row by each column.
If is an by matrix, and is an by matrix then is defined as
Let's look at an example:
Suppose we want to multiply the two matrices: We multiply each column by each row in the following way. The number in the th row and th column in the resulting matrix is obtained by multiplying each number in the th row of the first matrix by the th column of the second matrix, and then taking the sum.
So, we take the first row and first column to get the first value:
So, we have
Note that the number of rows in the first matrix must be equal to the number of columns in the second matrix.

