Group: | Matrix Manipulation |
Topic: | Sorting and Counting |
See also: | index |
Function: | sort | |
Description: | sort sorts the rows of a matrix. If column c1 is specified the matrix will be sorted with respect to column c1. That is, the rows of the matrix will be arranged in order that elements of column c1 are in ascending (descending) order. |
Usage: | z = sort (x, c) | |
Input: | ||
x | n x p x d1 x ...x dn array | |
c | m x 1 vector | |
Output: | ||
z | n x p x d1 x ...x dn array |
x = #(3, 1, 1, 3, 1)~#(4, 5, 4, 2, 4)~#(1, 5, 4, 0, 1) sort (x', #(-1, 2))
Contents of sort [1,] 4 5 4 2 4 [2,] 3 1 1 3 1 [3,] 1 5 4 0 1
Group: | Matrix Manipulation |
Topic: | Sorting and Counting |
See also: | index |