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

8 views (last 30 days)
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

Azzi Abdelmalek
Azzi Abdelmalek on 21 Apr 2014
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

Find more on Matrices and Arrays in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!