When the number of columns in one matrix is equal to the number of rows in another matrix, they can be multiplied.

For example, if Matrix X is 2×3 and Matrix Y is 3×3, they can be multiplied. This is because the number of columns in Matrix X is equal to the number of rows in Matrix Y.

To multiply matrices, we must multiply all rows by all columns and add the products for each:

Notice that the new matrix has taken on the row dimensions of the first matrix, and the column dimensions of the second matrix.