Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: sortrows
Date: Wed, 28 Apr 2010 16:49:04 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 30
Message-ID: <hr9ou0$15o$1@fred.mathworks.com>
References: <hr9khc$74q$1@fred.mathworks.com> <hr9mc1$a4o$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1272473344 1208 172.30.248.35 (28 Apr 2010 16:49:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 28 Apr 2010 16:49:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: news.mathworks.com comp.soft-sys.matlab:630669

"someone" <someone@somewhere.net> wrote in message <hr9mc1$a4o$1@fred.mathworks.com>...
> ........
> >> B = sortrows(A')'
> ........

  It depends on what Ulrik wants to happen in case of ties in that first row.  If he wants to continue to sort in other rows based on those "tied" columns, then that would be correct, but if the desire is to leave columns unchanged with ties in the first row, then he should use this:

 B = sortrows(A',1)';

  An example would be

 A = 2  2
     3  1
     2  5 .

Does he want

 B = 2  2
     1  3
     5  2

with sortrows(A')' or

 B = 2  2
     3  1 
     2  5

with sortrows(A',1)' ?

Roger Stafford