1
gsort Scilab Group Scilab Function gsort
3
gsort - decreasing order sorting
7
[s, [k]]=gsort(v,flag1)
8
[s, [k]]=gsort(v,flag1,flag2)
10
v,s : real vector/matrix; character string vector/matrix
13
: a string 'r', 'c','g','lr' and 'lc'.
16
: a string 'i' for increasing and 'd' for decreasing order. k : vector or
20
gsort is similar to sort with additional properties. The third argument
21
can be used to chose between increasing or decreasing order. The second
22
argument can be used for lexical orders.
24
[s,k]=gsort(a,'g') and [s,k]=gsort(a,'g','d') are the same as
25
[s,k]=gsort(a). They perform a sort of the entries of matrix a, a being
26
seen as the stacked vector a(:) (columnwise). [s,k]=gsort(a,'g','i')
27
performs the same operation but in increasing order.
29
[s,k]=gsort(a,'lr') sort the rows of the matrix int(a) ( if a is a real
30
matrix) or a (if a is a character string matrix) in lexical decreasing
31
order. s is obtained by a permutation of the rows of matrix int(a) (or
32
a) given by the column vector k) in such a way that the rows of s verify
33
s(i,:) > s(j,:) if i<j. [s,k]=gsort(a,'lr','i') performs the same
34
operation for increasing lexical order
36
[s,k]=gsort(a,'lc') sort the columns of the matrix int(a) ( if a is a
37
real matrix) or a (if a is a character string matrix) in lexical
38
decreasing order. s is obtained by a permutation of the columns of
39
matrix int(a) (or a) given by the row vector k) in such a way that the
40
columns of s verify s(:,i) > s(:,j) if i<j. [s,k]=gsort(a,'lc','i')
41
performs the same operation for increasing lexical order
48
[alr1,k]=gsort(alr,'lr','i')
49
[alr1,k]=gsort(alr,'lc','i')