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

 Réponse acceptée

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

2 commentaires

R yan
R yan le 21 Avr 2014
Modifié(e) : R yan le 21 Avr 2014
thanks, but I want to know the position of the element on the sorted array

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by