find matching rows in matrices
이전 댓글 표시
I want to find which rows in two matrices that are matching.
If I for example have
A =
1 2
4 5
9 7
1 2
6 5
and
B =
2 5
1 2
9 2
1 2
I would like a result like
index_A=[1 4] index_B=[2 4].
Any idea how to solve this?
채택된 답변
추가 답변 (1개)
Andrei Bobrov
2014년 6월 6일
C = intersect(A,B,'rows')
index_A= find(ismember(A,C,'rows'));
index_B= find(ismember(B,C,'rows'));
댓글 수: 1
카테고리
도움말 센터 및 File Exchange에서 Arithmetic Operations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!