Sorting group position from 1
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Abhineet Prakash
am 28 Nov. 2022
Beantwortet: Jonas
am 28 Nov. 2022
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 Kommentare
Akzeptierte Antwort
Jonas
am 28 Nov. 2022
i think you are searching for this:
[~,~,c]=unique([2 3 2 1],'stable')
[~,~,c]=unique([3 3 1 2],'stable')
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Shifting and Sorting Matrices finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!