<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#330000">
<br>
Le 09/03/2011 06:33, computidoo a écrit :
<blockquote cite="mid:1299648798194-2654045.post@n3.nabble.com"
type="cite">
<pre wrap="">I have a matrix and i want the row to be order as culom 2 in the matrix
example
a=[1 2 3 ;
2 3 1;
3 1 2]
</pre>
</blockquote>
<br>
[foo k] = gsort(a(:,2),'r','i')<br>
b=a(k,:)<br>
<br>
more info:<br>
help gsort<br>
help extraction<br>
<br>
<br>
br<br>
avs<br>
<br>
<br>
<br>
<br>
<br>
<blockquote cite="mid:1299648798194-2654045.post@n3.nabble.com"
type="cite">
<pre wrap="">
so the answer will be
[3 1 2;
1 2 3;
2 3 1]
best regards
computidoo
--
View this message in context: <a class="moz-txt-link-freetext" href="http://mailinglists.scilab.org/sort-problem-tp2654045p2654045.html">http://mailinglists.scilab.org/sort-problem-tp2654045p2654045.html</a>
Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.
</pre>
</blockquote>
<br>
<br>
</body>
</html>