Group repeated values in an array and mention the repeated value with position
18 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I need to group the repeated value in an array. After grouping the results should be
group = repeated value
position
Example:
a=[ 6 6 5 6 5 6 6]
Expected result:
group 1 = 5
3 5
group 2 = 6
1 2 4 6 7
Thank you in advance
2 Kommentare
Rik
am 4 Jan. 2022
What have you tried so far? I would try something with unique and ismember, or with histcounts.
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Matrices and Arrays 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!