how to reverse "sort"
Afficher commentaires plus anciens
For example we have a row like
m=[1 6 2 8 9] [Y,I] = sort(m)
then it gives you
Y =
1 2 6 8 9
I =
1 3 2 4 5
But I would like to sort them from big number to small
Réponse acceptée
Plus de réponses (1)
Wayne King
le 10 Sep 2011
Hi, have you read the documentation for sort()?
m = [1 6 2 8 9];
[Y,I] = sort(m,'descend');
Wayne
Catégories
En savoir plus sur Shifting and Sorting Matrices dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!