matrix get-col

For filters.

Extract a column from a 2D matrix.

Command Type

built-in

Signature

> matrix get-col {flags} (index)

Parameters

  • index: The column index to extract (0-based).

Input/output types:

input output
matrix list<float>

Examples

Get the first column of a 2x3 matrix

> matrix zeros 2 3 | matrix set-col 0 [1.0 2.0] | matrix get-col 0 | to nuon
[1.0, 2.0]

Get the second column of a 2x2 identity matrix

> matrix identity 2 | matrix get-col 1 | to nuon
[0.0, 1.0]

Ported from nushell/nushell.github.io. Copyright (c) 2021 Nushell Project. MIT License.