[Scilab-users] sort a table/matrix

Samuel Gougeon sgougeon at free.fr
Sat Nov 10 16:39:40 CET 2012


Le 10/11/2012 15:06, Paul Carrico a écrit :
>
> D= [
>
> 10 3 11 10 13;
>
> 49 6 -1 -1 0;
>
> 178 39 9 -451 3;
>
> 10110 -12 1 -9 45 ;
>
> -13514 15 78 -99 3]
>
> /// each line is sorted from the 1rst column (in increasing order)/
>
> D_expeted= [
>
> -13514 15 78 -99 3;
>
> 10 3 11 10 13;
>
> 49 6 -1 -1 0;
>
> 10110 -12 1 -9 45;
>
> 178 39 9 -451 3;
>
> ]
>
gsort(D,"lr","i")

will do it.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20121110/8817bc34/attachment.htm>


More information about the users mailing list