Sorting a Matrix by columns
17 ビュー (過去 30 日間)
古いコメントを表示
NotRiyad NotHosein
2021 年 3 月 20 日
コメント済み: NotRiyad NotHosein
2021 年 3 月 21 日
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 件のコメント
採用された回答
Cris LaPierre
2021 年 3 月 21 日
I would suggest transposing your matrix, sortrows, then transpose the result.
A=rand(5)
B=sortrows(A')'
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Shifting and Sorting Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!