From: Aui on 29 Jan 2010 03:30 Hi Steve, thanks! Finally, got it. >> A = [1 200 300; 2 200 200; 3 100 100;]; >> [d1,d2] = sort(A(:,2)); >> B=A(d2,:); >> sortrows(B,3) ans = 3 100 100 2 200 200 1 200 300
From: Jan Simon on 29 Jan 2010 11:12 Dear Aui! > Finally, got it. > >> A = [1 200 300; > 2 200 200; > 3 100 100;]; > >> [d1,d2] = sort(A(:,2)); > >> B=A(d2,:); > >> sortrows(B,3) > > ans = > 3 100 100 > 2 200 200 > 1 200 300 What about: sortrows(A, [2, 3]) Kind regards, Jan
From: Aui on 31 Jan 2010 02:04
Hi Jan, Thanks. That's a lot more better. Didn't know we can do that~~! |