Group repeated values in an array and mention the repeated value with position
4 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
Rik
2022 年 1 月 4 日
What have you tried so far? I would try something with unique and ismember, or with histcounts.
採用された回答
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Resizing and Reshaping Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!