When can you multiply one matrix by another matrix?

You can multiply two matrices if, and only if, the number of columns in the first matrix equals the number of rows in the second matrix. (Link on columns vs rows )

In the picture above , the matrices can be multiplied since the number of columns in the 1st one, matrix A, equals the number of rows in the 2^{nd}, matrix B.

Two Matrices that can not be multiplied

Matrix A and B below cannot be multiplied together because the number of columns in A $$ \ne $$ the number of rows in B. In this case, the multiplication of these two matrices is not defined.

Another example of 2 matrices you can not multiply

Matrix C and D below cannot be multiplied.

Can the 2 matrices below be multiplied?

No

Since the number of columns in Matrix A does not equal the number of rows in Matrix B.

So, what are the dimensions of the product matrix?

The product matrix's dimensions are (rows of first matrix) × (columns of the second matrix).

OK, so how do we multiply two matrices?

In order to multiply matrices,

Step 1: Make sure that the the number of columns in the 1^{st} one equals the number of rows in the 2^{nd} one.
(The pre-requisite to be able to multiply)

Step 2: Multiply the elements of each row of the first matrix by the elements of each column in the second matrix.

Step 3: Add the products.

It's easier to understand these steps, if you go through interactive demonstrations below.