Documentation moved.
This entry is now part of the unified function reference. Open the unified page →
Function
src/index.ts:850nerdamer.matrix
nerdamer.matrix(...args: Vector | NerdamerInput[][]): MatrixConstructs a Matrix from the provided rows. Each argument is an array representing one row of the matrix. All rows must have the same length; elements are converted to Expression instances.
throws
MathError If rows have inconsistent lengths.
Parameters
| Name | Type | Description |
|---|---|---|
args | Vector | NerdamerInput[][] | One or more arrays, each representing a row of the matrix. |
Returns
Matrix — A new Matrix instance.
Examples
// 2×2 identity matrix
matrix([1, 0], [0, 1]).text() // "matrix([1, 0], [0, 1])"
// 2×3 matrix
matrix([1, 2, 3], [4, 5, 6]).text()