How can I sort cell arrays along with vectors?
1 回表示 (過去 30 日間)
古いコメントを表示
I am getting very confused by all the documentation on sorting in MATLAB, so can someone please answer this very specific question?
I have a number of numeric vectors along with two associated cell arrays, ie
How can I sort them all together with the order defined by one of the numeric vectors?
3 件のコメント
採用された回答
Walter Roberson
2024 年 1 月 4 日
[~, SortOrder] = sort(vtstring_datim_begs); %or as appropriate
s_ends = vtstring_datim_ends(SortOrder);
s_durs = vtstring_durs(SortOrder);
s_ids = vtstring_ids(SortOrder);
s_max_MLs = vtstring_max_MLs(SortOrder);
%and so on
その他の回答 (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!