How to combine repeated same value to a single value or variable
이전 댓글 표시
X=[3 5 ; 1 2 ; 5 6 ; 3 5 ] How to make like Y=[3 5; 1 2; 5 6] ie; representing [3 5] for single time rather displaying it twice
답변 (1개)
Rik
2018년 3월 12일
1 개 추천
댓글 수: 3
RAJASEKAR S
2018년 3월 12일
James Tursa
2018년 3월 12일
See the 'rows' option.
Rik
2018년 3월 12일
That is why the link leads you to the 'rows' flag example:
[C,ia,ic] = unique(A(:,1:2),'rows')
In your case:
X=[3 5 ; 1 2 ; 5 6 ; 3 5 ];
Y=unique(X,'rows','stable');
카테고리
도움말 센터 및 File Exchange에서 Structures에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!