Description
Returns resulting matrix from the multiplication of two matrices. First matrix must be of the size n × k, while the second must be of the size k × m, i.e columns matrix1 == rows matrix2. The resulting matrix will be of the size n × m. If the shapes do not match, empty array [] will be returned.
Syntax
matrix1 matrixMultiply matrix2
Parameters:
Returns: Array of Array of Numbers - resulting matrix of the size n(rows) × m(columns)
Examples
Example 1
[
[2],
[2]
]
matrixMultiply
[
[3]
]
Example 2
[
[-1,0,0],
[0,-1,0]
]
matrixMultiply
[
[1,2],
[3,1],
[2,3]
]
See also
matrixTranspose · vectorAdd · vectorMagnitude · vectorNormalized · vectorMultiply · vectorDotProduct · vectorCrossProduct · vectorDistance · vectorLinearConversion · vectorCos · vectorFromTo · vectorModelToWorld · vectorWorldToModel · BIS_fnc_transformVectorDirAndUp
Note that this command won't automatically transform a 1D array into a column vector
[[-1,0,0],[0,-1,0],[0,0,-1]] matrixMultiply [1,2,3]
[[-1,0,0],[0,-1,0],[0,0,-1]] matrixMultiply [[1,2,3]]
[[-1,0,0],[0,-1,0],[0,0,-1]] matrixMultiply [[1], [2], [3]]