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!