find the repetition of matrix rows
조회 수: 1 (최근 30일)
이전 댓글 표시
I want to find out if the row i of mxn matrix is repeated ,the code should give logic 1.Otherwise zero"there are many ways but Im searching for the best one" Thanks
댓글 수: 0
채택된 답변
the cyclist
2014년 5월 8일
% Example of data
X = [6 5 4;
1 2 3;
1 2 3;
1 2 4;
1 2 3];
[~,~,A] = unique(X,'rows','stable');
[n, bin] = histc(A, unique(A));
multiple = find(n > 1);
indexToDuplicate = ismember(bin, multiple);
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!