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

6 vues (au cours des 30 derniers jours)
R yan
R yan le 21 Avr 2014
Commenté : Azzi Abdelmalek le 21 Avr 2014
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

Azzi Abdelmalek
Azzi Abdelmalek le 21 Avr 2014
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
Azzi Abdelmalek
Azzi Abdelmalek le 21 Avr 2014
idx=find(sort(v)==2)

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Matrices and Arrays dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by