Sorting group position from 1
1 回表示 (過去 30 日間)
古いコメントを表示
I have a group number of array
1) [2 3 2 1] I want [1 2 1 3]
2) [3 3 1 2] I want [1 1 2 3]
0 件のコメント
採用された回答
Jonas
2022 年 11 月 28 日
i think you are searching for this:
[~,~,c]=unique([2 3 2 1],'stable')
[~,~,c]=unique([3 3 1 2],'stable')
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!