How to find indices of ranking of element in matrix
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Pradya Panyainkaew
le 8 Fév 2018
Modifié(e) : Tomás Nunes
le 19 Mar 2018
if i have A=[0 32 103 59 543]; How can I find a ranking indices of each element to get a result like this
Result=[5 4 2 3 1]
Thanks in advance
0 commentaires
Réponse acceptée
Birdman
le 8 Fév 2018
[~,idx]=ismember(A,sort(A,'descend'))
2 commentaires
Tomás Nunes
le 19 Mar 2018
Modifié(e) : Tomás Nunes
le 19 Mar 2018
how would it look if we had a matrix instead? for example, a 3x3 matrix, in which I want to rank by row. A = [4 3 6;7 8 3; 2 4 1] to look like this idx = [2 3 1; 2 1 3; 2 1 3]
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur NaNs 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!