Programmer Guide/Command Reference/EVAL/vmrow: Difference between revisions
From STX Wiki
< Programmer Guide | Command Reference | EVAL
Jump to navigationJump to search
No edit summary |
No edit summary |
||
Line 7: | Line 7: | ||
Example: | Example: | ||
#a := eval vv(1,2,3,4,5) | |||
#a := eval vv(1,2,3,4,5) | #b := eval init(5,2,0) | ||
#b := eval init(5,2,0) | #c := eval vmcol($#a, $#b, $#a) | ||
#c := eval vmcol($#a, $#b, $#a) | // -> $#c is a matrix with 4 rows and 5 columns: | ||
// -> $#c is a matrix with 4 rows and 5 columns: | // $#c[*,*] = $#a, #c[1,*] = $#b[*,0], $#c[2,*] = $#b[*,1], $#c[3,*] = $#a | ||
// $#c[*,*] = $#a, #c[1,*] = $#b[*,0], $#c[2,*] = $#b[*,1], $#c[3,*] = $#a | |||
[[Programmer_Guide/Command_Reference/EVAL#Functions|<function list>]] | [[Programmer_Guide/Command_Reference/EVAL#Functions|<function list>]] |
Revision as of 15:50, 6 April 2011
Create a matrix by merging columns of source vectors and/or matrices into the rows of the result.
- Usage
vmrow(x1 {, x2 {, .. }})
- x1, x2, ..
- source vectors and/or matrices with the same number of rows
- Result
- A matrix with
nrow(x1)
columns. The columns of the arguments are merged from left to right into the rows of the result matrix. Note:vmrow(a,b,c)
returns the same result astrn(vmcol(a,b,c))
, butvmrow
is faster and uses less memory than the nested command. - 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