Command Reference : Matrix Language Reference
  
 
@sort
Syntax: @sort(o[, order, ties])
Argument 1: matrix or vector, o
Argument 2: (optional) option, order
Argument 3: (optional) option, ties
Return: matrix, vector
Returns the sorted elements of the matrix or vector object o.
Note that sorting a matrix sorts every element of the matrix and arranges the results by column, with the first element in the first row of the first column, and the last element in the last row of the last column.
The first option controls the direction of the ranking:
“a” (ascending - default) or “d” (descending)
The second option controls tie-handling:
Ties are broken according to the setting of t: “i” (ignore), “f” (first), “l” (last), “a” (average - default), “r” randomize.
If you wish to specify tie-handling options, you must also specify the order option (e.g. ‘@sort(x, “a”, “i”)’).
Example:
vector rank1 = @sort(v1,"a","f")
See also @ranks, @capplyranks, @rapplyranks, @permute, @colsort, and @rowsort.