Multiplies two matrices.
MMULT(A, B)
A |
- |
A matrix |
B |
- |
A matrix |
A matrix.
W1: {{1, 3, 4},
{5, 7, 9},
{8, 9, 12}}
W2: {{1, 3, 2},
{2, 4, 5},
{1, 2, 0}}
mmult(W1,W2) == {{11, 23, 17},
{28, 61, 45},
{38, 84, 61}}
mmult(W2,W1) == {{32, 42, 55},
{62, 79, 104},
{11, 17, 22}}
For matrices A and B, C = mmult(A, B) is computed formally with:
The number of columns in A must be equal to the number of rows in B. The number of rows in the output matrix is equal to the number of rows in A, and the number of columns in the output matrix is equal to the number of columns in B.
Matrix multiplication is not commutative, the product is not independent of the order of the arguments:
However the determinant is independent of the order of the product:
Matrix multiplication is associative:
Matrix multiplication is distributive over addition:
mmult(a, b) is equivalent to a *^ b.
See DADiSP/MatrixXL to significantly optimize MMULT.