mirror of
https://github.com/josdejong/mathjs.git
synced 2026-01-18 14:59:29 +00:00
26 lines
797 B
Markdown
26 lines
797 B
Markdown
# Function matrix
|
|
|
|
Create a matrix. The function creates a new math.type.Matrix object.
|
|
|
|
The method accepts the following arguments: matrix() creates an empty matrix matrix(data) creates a matrix with initial data.
|
|
|
|
Example usage: var m = matrix([[1, 2], [3, 4]); m.size(); // [2, 2] m.resize([3, 2], 5); m.valueOf(); // [[1, 2], [3, 4], [5, 5]] m.get([1, 0]) // 3
|
|
|
|
|
|
### Parameters
|
|
|
|
Parameter | Type | Description
|
|
--------- | ---- | -----------
|
|
`data` | Array | Matrix | A multi dimensional array
|
|
|
|
### Returns
|
|
|
|
Type | Description
|
|
---- | -----------
|
|
Matrix | matrix
|
|
|
|
|
|
|
|
|
|
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|