find the rank of a element in a an array of numbers

Rank of 3 in [4 5 2 7 8] is two. Is there a matlab function for this? How to do it? thanks

 Accepted Answer

v=[4 5 2 7 8]
idx=find(v==2)

2 Comments

R yan
R yan on 21 Apr 2014
Edited: R yan on 21 Apr 2014
thanks, but I want to know the position of the element on the sorted array

Sign in to comment.

More Answers (0)

Categories

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!