@columnextract |

Extract a column from the matrix.

Syntax: @columnextract(m, n)

m: matrix, sym

n: integer

Return: vector

Extract a vector from column n of the matrix object m, where m is a matrix object.

Note that we recommend that extraction be performed using the newer “.col” object data member functions. See
“Matrix Data Members” and
“Sym Data Members” and the examples below.

Examples

matrix m1 = @mnrnd(20, 5)

vector v1 = @columnextract(m1,3)

extracts column 3 from the matrix M1.

sym s1 = @mnrnd(5, 5)

vector v2 = @columnextract(s1, 5)

Alternately, using the data member functions, we have

vector v1a = m1.@col(3)

vector v2a = s1.@col(5)

Cross-references

See also
@rowextract and
@subextract.

See
“Matrix Data Members” and
“Sym Data Members”.