Please note that the recommended version of Scilab is 2023.1.0. This page might be outdated.
However, this page did not exist in the previous stable version.
lexicographic matrix rows sorting
[N, [k]]=lex_sort(M [,sel] [,'unique'])
column vector of integers
N=lex_sort(M) sorts the rows (as a group) of the
M in ascending order. If required the output
k contains the ordering:
k such as
N is uequal to
N=lex_sort(M,sel [,'unique']) produces the same
result as the following sequence of instructions:
[N,k]=lex_sort(M(:,sel) [,'unique']); N=M(k,:)
'unique' flag has to be given if one wants to
retain only unique rows in the result. Note that
lex_sort(M,sel,'unique') retains only rows such that
M(:,sel) are unique.
|<< gsort||Search and sort||vectorfind >>|