Ranking matrix by rows
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
sushma sharma
le 11 Fév 2015
Modifié(e) : Azzi Abdelmalek
le 11 Fév 2015
Hi,
I have a 3x3 matrix. I want to create a matrix that shows the magnitude rank of the elements in the rows with 1 being the maximum and 3 being the minimum. for example:
a = [3 4 1; 5 1 8; 8 4 1]
b = [2 1 3; 2 3 1; 1 2 3]
Any help would be appreciated!
Sushma
0 commentaires
Réponse acceptée
Azzi Abdelmalek
le 11 Fév 2015
Modifié(e) : Azzi Abdelmalek
le 11 Fév 2015
EDIT
[~,jj]=sort(a,2,'descend');
[~,b]=sort(jj,2)
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Shifting and Sorting Matrices 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!