Library: | math |
See also: | csort |
Quantlet: | csortcol | |
Description: | sorts with respect to either a real part of a column or an imaginary part of a column c. If 1 <= c <= cols(xr) it sorts after the real part of x, if cols(xr) < c <= cols(xr)+cols(xi) it sorts the imaginary part after column c-cols(xr). |
Usage: | z = csortcol(x, c) | |
Input: | ||
x | n x p x d1 x ... x dn complex array | |
c | scalar column of x | |
Output: | ||
z | n x p x d1 x ... x dn array real part of sorted x |
library("math") x = complex(#(1,2)~#(2,3), #(2,1)~#(1,1)) c = 3 csortcol(x, c)
Contents of z.re [1,] 2 3 [2,] 1 2 Contents of z.im [1,] 1 1 [2,] 2 1