Matrix multiplication is quite an extensive operation to do. When multiplying a matrix by another matrix , each element from the result matrix is calculated by the rows of times the columns of .
Before attempting, one should guarantee that the numbers of columns from is equal to the number of rows from . The result will have the number of rows from and the columns from .
Dot product
When multiplying matrices, one use the dot product, which is when matching members are multiplied, and then summed up. When working with matrices, a row is multiplied by a column, element-wise, and then summed up. For example: