Multiplying matrices by scalars
In scalar multiplication, each entry in the matrix is multiplied by the given scalar.
The component in the ii -th row and the j -th column of C is the dot product between the i -th row of A and the j -th column of B.
In the i -th row of A, the first element is multiplied by the first element of the j -th column of B, then the second element of the i -th row is multiplied by the second element in the j -th column, and thus by the n -th element. Then we add up these products.
Some simple rules for multiplying matrices
- The number of columns in the first matrix must be equal to the number of rows in the second matrix.
- The result matrix has the same number of rows as the first matrix and the same number of columns as the second matrix: