# Matrix Multiplication

Matrix Multiplication is defined as the multiplication of two matrices.

It requires the number of columns in the first matrix to equal the number of rows in the second matrix. The resulting matrix will have the same number of rows as the first matrix, and the same number of columns as the second matrix. To multiply, take the dot product of the corresponding rows and columns. For example, dot product the first row of the first matrix with the first column of the second matrix. To dot product, add together the multiplication of each entity of the first matrix’s first row with each entity of the second matrix’s first column. Put the resulting answer in the first row, first column of the new matrix. Continue this process with all the rows and columns.

* Scalar Row Vector Column Vector Matrix
Scalar Multiplies the two scalar values. Multiplies the scalar with each element in the row vector. Multiplies the scalar with each element in the column vector. Multiplies the scalar with each element in the matrix.
Row Vector Multiplies the scalar with each element in the column vector.   Use matrix multiplication. Use matrix multiplication.
Column Vector Multiplies the scalar with each element in the column vector. Use matrix multiplication.   Use matrix multiplication.
Matrix Multiplies the scalar with each element in the matrix. Use matrix multiplication. Use matrix multiplication. Use matrix multiplication.

Examples

``````3*3
ans = 9

[1 5 4]* [3; 5; 7]
ans = 56

[3 4; 5 8]*[4; 7]
ans = [40 ; 76]``````

Invalid Examples

``````[3 5 4]*[3 6 7]
[3 4]*[1 4;3 6; 10 2]``````