Given two matrices A[1000×4] and B[500×4] what is the fastest way in MATLAB to extract the complete rows of A which share the same element values in column 4 as B does?
for example if,
A=[1 2 3 7; 2 6 9 1; 8 3 4 8] and B=[9 2 5 1; 6 2 1 5; 3 6 6 8].
What is the most efficient way to create a new array
C=[2 6 9 1; 8 3 4 8],
having the rows of A with same element in column 4 as B does?
Thanks!
Best Answer