How to extract all similar row of matrix A to matrix B
Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
Ältere Kommentare anzeigen
I have matrix A & B, I want to find similar rows in matrix A, to Matrix B.
A=[1 2 3;0 1 3;4 8 9;0 1 3]
B=[0 1 3]
I want to extract all similar row in A to B. I want the resulted matrix C=[0 1 3;0 1 3] because I have two similar rows in A (row 2 and row 4). I use intersect, but it only give me one row (will be avoiding duplicate row).
ance.
Many thanks in adv
Antworten (1)
Andrei Bobrov
am 1 Jul. 2015
C = A(ismember(A,B,'rows'),:);
Diese Frage ist geschlossen.
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!