how to track location of number in array after sorting?

1 vue (au cours des 30 derniers jours)
Ali Mukhtar
Ali Mukhtar le 2 Sep 2019
Commenté : Ali Mukhtar le 2 Sep 2019
i have a array B=[ 95 75 80 90 40 55] which i want to save data like B=[B1 B2 B3 B4 B5 B6] after sorting i got B=[95 90 80 75 55 40] now i want the exact location of B array like B=[B1 B4 B3 B2 B6 B5] want to know changed location and also want to use the numeric value of B1 for example want to save in n=1 to use for selection purpose.

Réponse acceptée

madhan ravi
madhan ravi le 2 Sep 2019
[~,Wanted] = sort(B,'descend')
  7 commentaires
madhan ravi
madhan ravi le 2 Sep 2019
retriever
Ali Mukhtar
Ali Mukhtar le 2 Sep 2019
great thanks for your help. it is very kind of you giving me reply

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Data Types dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by