Library: | math |
See also: | csortcol |
Quantlet: | csort | |
Description: | csort sorts the rows of a complex matrix with respect to the absolute value of the complex numbers. If a column c is specified the rows of the matrix will be ordered with respect to the elements of column c in ascending (descending) order. |
Usage: | z = csort(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 complex array |
library("math") x = complex(#(1,2)~#(3,2), #(1,2)~#(1,1)) c = 2 csort(x, c)
Contents of z.re [1,] 2 2 [2,] 1 3 Contents of z.im [1,] 2 1 [2,] 1 1