mirror of
https://github.com/josdejong/mathjs.git
synced 2025-12-08 19:46:04 +00:00
663 B
663 B
Function flatten
Flatten a multi dimensional matrix into a single dimensional matrix.
Syntax
math.flatten(x)
Parameters
| Parameter | Type | Description |
|---|---|---|
x |
Matrix | Array | Matrix to be flattened |
Returns
| Type | Description |
|---|---|
| Matrix | Array | Returns the flattened matrix |
Examples
math.flatten([[1,2], [3,4]]) // returns [1, 2, 3, 4]