col
Represents a column in a matrix.
Syntax
-
col(A, n)
-
A
is a matrix -
n
is a positive integer
-
The returned value is an lvalue.
Description
If A
is a matrix and n
is an integer between 1
and width(A)
(inclusively), then col(A, n)
represents the n
th column of A
; typewise this is a vector. col(A, n)
is an lvalue, so it may be assigned to. The value assigned to it must be a vector of dimension height(A)
. If A
is a real matrix, col(A, n)
can only be assigned a real vector.
Examples
A ≔ ❨❨2, 1, −i❩, ❨1, 0, 2❩, ❨4, i, 2❩, ❨0, 1, −1❩❩
⎛ 2 1 −i⎞ ⎜ 1 0 2⎟ ⎜ 4 i 2⎟ ⎝ 0 1 −1⎠
col(A, 1)
⎛2⎞ ⎜1⎟ e⎜4⎟ ⎝0⎠
col(A, 1) ≔ ❨0, 1, 2, 3❩
⎛0⎞ ⎜1⎟ e⎜2⎟ ⎝3⎠
A
⎛ 0 1 −i⎞ ⎜ 1 0 2⎟ ⎜ 2 i 2⎟ ⎝ 3 1 −1⎠