sort rows of a matrix based on their maximum value
10 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello,
Consider a 100x10 matrix.
Each 1x10 row has a maximum value.
How can I sort the rows of the matrix in ascending order based only on their maximum value?
Thank you very much.
Best,
Pavlos
0 commentaires
Réponse acceptée
Plus de réponses (2)
Azzi Abdelmalek
le 11 Sep 2013
Modifié(e) : Azzi Abdelmalek
le 11 Sep 2013
Edit2
[ii,ii]=sort(max(A'))
BB=A(ii,:)
1 commentaire
Simon
le 11 Sep 2013
A=randi(100,10,5);
for n = 1:size(A, 1)
B(n,:) = sort(A(n,:));
end
0 commentaires
Voir également
Catégories
En savoir plus sur Shifting and Sorting Matrices dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!