|
"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <gq59fh$nvg$1@fred.mathworks.com>...
> "Simon Luk" <simon.luk@student.uts.edu.au.REMOVETHIS> wrote in message <gq58qt$dtq$1@fred.mathworks.com>...
> > Hi Bruno,
> >
> > I should of said this earlier, I want to sort with respect to 2nd column decending order.
> > So how would I do that?
>
> c={'a' 1;
> 'ab' 2;
> 'aaa' 3}
>
> [dumm is]=sort([c{:,2}],'descend')
> c=c(is,:)
>
> % Bruno
Bruno, this also answers a question that I really needed to know the answer to as well, so I appreciate it.
After studying your commands and examining Matlab help, I finally understand what you did.
But wow... as a long-time Excel user and a relatively new Matlab user, to me it makes no sense that Mathworks would require nearly impenatrable statements like these to do a simple sort. Um -- just let me provide the column I want to sort on, and sort away! Of course, "sortrows" is like that, but it seems about impossible to make it work on matrices with mixed text and numeric data. Oh, well.
|