Multiplies a matrix by a vector.
matrixvectormultiply(matrix, vector)
| Parameter | Type | Description |
|---|---|---|
matrix |
Array | 2D array representing the matrix (m×n) |
vector |
Array | 1D array representing the vector (length n) |
Array - The resulting vector (length m).
The matrixvectormultiply function multiplies a matrix by a column vector. The vector length must equal the number of columns in the matrix.
// Matrix: [[1, 2], [3, 4]]
// Vector: [5, 6]
Result = MATRIXVECTORMULTIPLY([[1, 2], [3, 4]], [5, 6])
// Result: [17, 39]
// [1*5 + 2*6, 3*5 + 4*6] = [17, 39]
// Apply transformation to point
NewPoint = MATRIXVECTORMULTIPLY(RotationMatrix, Point)
// Compute linear combination of basis vectors
Result = MATRIXVECTORMULTIPLY(BasisMatrix, Coefficients)
- Linear transformations: Apply transforms to points
- Solving equations: Part of solving Ax = b
- Graphics: Coordinate transformations
- Physics: Linear operations
- matrixmultiply - Matrix-matrix multiplication
- matrixtranspose - Transpose matrix
- matrixinverse - Matrix inverse
- Vector treated as column vector
- Vector length must match matrix columns
- Uses the Math service's
matrixVectorMultiplymethod