lex_sort

Stefan Du Rietz sdr at durietz.se
Sun Aug 17 12:18:59 CEST 2008


I am using Scilab 4.1.2 under Windows XP.

-->M = [2 1 2; 2 1 1; 1 2 1; 1 1 1]
  M  =
     2.    1.    2.
     2.    1.    1.
     1.    2.    1.
     1.    1.    1.
-->lex_sort(M)
  ans  =
     1.    1.    1.
     1.    2.    1.
     2.    1.    1.
     2.    1.    2.

which is OK. But when I want to exclude the third column 
from the sorting, it does not work:

-->[N, k] = lex_sort(M, 1:2)
  k  =
     4.
     3.
     2.
     1.
  N  =
     1.    1.    1.
     1.    2.    1.
     2.    1.    1.
     2.    1.    2.

Am I doing anything wrong, or is this a bug?

/Stefan



More information about the users mailing list