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개)
참고 항목
범주
Find more on Shifting and Sorting Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!