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

9 visualizzazioni (ultimi 30 giorni)
Rank of 3 in [4 5 2 7 8] is two. Is there a matlab function for this? How to do it? thanks

Risposta accettata

Azzi Abdelmalek
Azzi Abdelmalek il 21 Apr 2014
v=[4 5 2 7 8]
idx=find(v==2)
  2 Commenti
R yan
R yan il 21 Apr 2014
Modificato: R yan il 21 Apr 2014
thanks, but I want to know the position of the element on the sorted array

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Shifting and Sorting Matrices in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by