mathjs
Version:
Math.js is an extensive math library for JavaScript and Node.js. It features a flexible expression parser with support for symbolic computation, comes with a large set of built-in functions and constants, and offers an integrated solution to work with dif
50 lines (31 loc) • 994 B
Markdown
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
# Function matrixFromColumns
Create a dense matrix from vectors as individual columns.
If you pass row vectors, they will be transposed (but not conjugated!)
## Syntax
```js
math.matrixFromColumns(...arr)
math.matrixFromColumns(col1, col2)
math.matrixFromColumns(col1, col2, col3)
```
### Parameters
Parameter | Type | Description
--------- | ---- | -----------
`cols` | ... Array | Matrix | Multiple columns
### Returns
Type | Description
---- | -----------
number[][] | Matrix | if at least one of the arguments is an array, an array will be returned
### Throws
Type | Description
---- | -----------
## Examples
```js
math.matrixFromColumns([1, 2, 3], [[4],[5],[6]])
math.matrixFromColumns(...vectors)
```
## See also
[matrix](matrix.md),
[matrixFromRows](matrixFromRows.md),
[matrixFromFunction](matrixFromFunction.md),
[zeros](zeros.md)