How can i find an eleiment which comes only one in a matrix ?????
조회 수: 1 (최근 30일)
이전 댓글 표시
Example
A=[1 2;1 3;1 4;1 5;2 4]
Ans should be [3 5]
댓글 수: 0
채택된 답변
Azzi Abdelmalek
2016년 6월 22일
편집: Azzi Abdelmalek
2016년 6월 22일
A=[1 2;1 3;1 4;1 5;2 4]
[ii,jj,kk]=unique(A)
b=accumarray(kk,(1:numel(kk))',[],@numel)
out=ii(b==1)
추가 답변 (1개)
Jos (10584)
2016년 6월 24일
When A only contains positive integers:
A = [1 2 3 1 2 4 1 2 4 5]
B = find(sparse(A(:),1,1)==1)
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!