Group repeated values in an array and mention the repeated value with position
8 次查看(过去 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 中查找有关 Matrices and Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!