finding similar rows in matrices
이전 댓글 표시
Hi, i have several matrices that has 3 columns each, but the number of rows is not equal. im trying to find a fast way of comparing the first two columns in all 3 matrices and to find the rows (column 1 and 2) that are identical in all 3 of them. i've tried "ismember", it works ok but when dealing with lots of matrices its too slow.
can anyone recomend a different function? thank you for your help.
댓글 수: 3
the cyclist
2014년 2월 11일
Can you post an example of your code, as well as some sample input/output that you expect? This will save a lot of guesswork on our part.
Dany
2014년 2월 11일
편집: the cyclist
2014년 2월 11일
SIVAKUMAR KARURNKARAN
2015년 4월 24일
thankyou sir i have one doubt in my coding.how to remove a duplicate matrices in the set of all matrices.
채택된 답변
추가 답변 (2개)
Jos (10584)
2014년 2월 11일
INTERSECT or ISMEMBER come into mind:
tf = ismember(C, A(ismember(A,B,'rows')), 'rows')
result = C(tf,:)
카테고리
도움말 센터 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!