Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

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

Example:
library("math")
x = complex(#(1,2)~#(3,2), #(1,2)~#(1,1))
c  = 2
csort(x, c)

Result:
Contents of z.re
[1,]        2        2
[2,]        1        3
Contents of z.im
[1,]        2        1
[2,]        1        1



Author: S Klinke, S. Hannappel, 19960423
(C) MD*TECH Method and Data Technologies, 05.02.2006