MATLAB: Corresponding values between two matrices

findmatrixmatrix manipulation

Hello,
I have two matrices of different sizes. Please see attached .mat files containing the matrices. Matrix A = [3168×2] and matrix B = [14×1].
The 14 values contained in the first column of matrix B are contained somewhere in the second column of matrix A. I need to identify which rows in A are these valinues contained and also extract the values contained in the first column for these rows.
Any suggestions?
Thanks in advance.

Best Answer

index=ismember(A(:,2),B(:,1));
A(index,1)