1
.TH lex_sort 1 "April 1999" "Scilab Group" "Scilab Function"
4
lex_sort - lexicographic matrix rows sorting
7
[N, [k]]=lex_sort(M [,sel] [,'unique'])
19
: column vector of integers
21
\fVN=lex_sort(M)\fR sorts the rows (as a group) of the matrix \fVM\fR
22
in ascending order. If required the output argument \fVk\fR contains
23
the ordering: \fV[N,k]=lex_sort(M)\fR returns \fVk\fR such as \fVN\fR is
24
uequal to \fVM(k,:)\fR .
26
\fVN=lex_sort(M,sel [,'unique'])\fR produces the same result as the
27
following sequence of instructions:
29
[N,k]=lex_sort(M(:,sel) [,'unique']);
33
The \fV'unique'\fR flag has to be given if one wants to retain only
34
unique rows in the result. Note that \fVlex_sort(M,sel,'unique')\fR
35
retains only rows such that M(:,sel) are unique.
39
M=round(2*rand(20,3));
43
[N,k]=lex_sort(M,[1 3],'unique')