--- layout: default ---

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.html), [matrixFromRows](matrixFromRows.html), [matrixFromFunction](matrixFromFunction.html), [zeros](zeros.html)