~ubuntu-branches/ubuntu/karmic/scilab/karmic

« back to all changes in this revision

Viewing changes to man/elementary/gsort.cat

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2002-03-21 16:57:43 UTC
  • Revision ID: james.westby@ubuntu.com-20020321165743-e9mv12c1tb1plztg
Tags: upstream-2.6
ImportĀ upstreamĀ versionĀ 2.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
gsort            Scilab Group            Scilab Function              gsort
 
2
NAME
 
3
   gsort - decreasing order sorting
 
4
  
 
5
CALLING SEQUENCE
 
6
 [s, [k]]=gsort(v )
 
7
 [s, [k]]=gsort(v,flag1)
 
8
 [s, [k]]=gsort(v,flag1,flag2)
 
9
PARAMETERS
 
10
 v,s  : real vector/matrix; character string vector/matrix
 
11
      
 
12
 flag1
 
13
       : a string 'r', 'c','g','lr' and 'lc'.
 
14
      
 
15
 flag2
 
16
       : a string 'i' for increasing and 'd' for decreasing order. k : vector or
 
17
      matrix of integers
 
18
      
 
19
DESCRIPTION
 
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.
 
23
  
 
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.
 
28
  
 
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 
 
35
  
 
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 
 
42
  
 
43
EXAMPLE
 
44
 alr=[1,2,2;
 
45
      1,2,1;
 
46
      1,1,2;
 
47
      1,1,1];
 
48
 [alr1,k]=gsort(alr,'lr','i')
 
49
 [alr1,k]=gsort(alr,'lc','i')
 
50
SEE ALSO
 
51
   find 
 
52