who to sort pairs of arrays in the same order one based on the other?
7 ビュー (過去 30 日間)
古いコメントを表示
Abdulaziz Abutunis
2015 年 11 月 8 日
コメント済み: Abdulaziz Abutunis
2015 年 11 月 8 日
Hello MATLAB experts, I have asked many questions and I really appreciate your prompt responses. My New question is that, I have set of pairs of arrays. In each pair, one array has numbers from 0 to 20 (but not arranged) for one variable values and the other array have decimal values presents the other variable values. I want to sort the elements in the first array in ascending order (0,1,2,...20) but at the same time I want to sort the other accompanied array of the pair in the same order (indices sorted similarly).
0 件のコメント
採用された回答
Walter Roberson
2015 年 11 月 8 日
[firstsordered, firstsortorder] = sort(first_array);
secondsorted = second_array(firstsortorder);
その他の回答 (1 件)
参考
カテゴリ
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!