Sort rows of a matrix
12 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello,
I would like to sort the rows of a matrix depending on the values of each row. So i sould sort the rows based on the first entry of the row, and then i would sort what i have based on the second row and so on. Here is an example, consider the following matrix
A =
1 2 3
1 2 4
3 1 2
1 1 1
The output should be the following
A =
1 1 1
1 2 3
1 2 4
3 1 2
0 commentaires
Réponses (1)
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!