Sorting a Matrix by columns
17 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
NotRiyad NotHosein
il 20 Mar 2021
Commentato: NotRiyad NotHosein
il 21 Mar 2021
I have a 12 x 12 matrix and I have used the command 'sortrows' to sort the matrix in ascending order of rows. How can I do the same but sorting by columns (i.e. ascending order of columns) instead of rows?
0 Commenti
Risposta accettata
Cris LaPierre
il 21 Mar 2021
I would suggest transposing your matrix, sortrows, then transpose the result.
A=rand(5)
B=sortrows(A')'
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Shifting and Sorting Matrices in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!