Sort 1 colum and other colums sort correspondingly
2 ビュー (過去 30 日間)
古いコメントを表示
Hello,
In attach is a picture of the data set I want to sort. I want sort by 'ZYGE' in ascending way. But I don't want the column of 'ZYGE' to change alone. The data must stick together. So that all the numbers of the row stick together, but the data gets sorted by 'ZYGE'. How do I do this?
採用された回答
Azzi Abdelmalek
2015 年 6 月 12 日
編集済み: Azzi Abdelmalek
2015 年 6 月 12 日
Use sortrows
v=[{'a' 'b' 'zygz' 'c'};num2cell(randi(4,10,4))] % Example
M=v(2:end,:)
out=sortrows(M,3)
0 件のコメント
その他の回答 (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!