Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Ranking as if with Excel.
Replies: 3   Last Post: Apr 22, 2013 10:25 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Caio

Posts: 1
Registered: 4/22/13
Ranking as if with Excel.
Posted: Apr 22, 2013 11:12 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi. Say I have a vector:
a=[0;1;50;3;4]

I want to get:
b=[5;4;1;3;2]
(in other words, the ranking of each element in descending order stored in the element's original location in that vector)

How can that be done in Matlab? All I seem to get is:
c=[3;5;4;2;1]
... which is if i do [~,c] = sort(a,'descend')

Thanks.




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.