vsubn
From STX Wiki
< Programmer Guide | Command Reference | EVAL
Jump to navigationJump to search
Extract rows from a vector or matrix.
- Usage
vsubn(x {, o {, n}})
- x
- source vector or matrix
- o
- offset, 0 <= o <
nrow(x)
- n
- length, n > 0 and o+n <=
nrow(x)
- Result
- A numerical object with
ncol(x)
columns and n rows, consisting of the rows o to o+n-1 of the argument x. - See also
- vv, vvget, vvset, vvcat, vmcol, vsubn, vsubc
Example:
#a := eval vv(1,2,3,4,5) #b := eval init(5,2,0) #c := eval vmcol($#a, $#b, $#a) // -> $#c is a matrix with 4 rows and 5 columns: // $#c[*,*] = $#a, #c[1,*] = $#b[*,0], $#c[2,*] = $#b[*,1], $#c[3,*] = $#a