%% Rows That Belong to a Set
% Create two matrices with a row in common.

A = [1 3 5 6; 2 4 6 8];
B = [2 4 6 8; 1 3 5 7; 2 4 6 8];

%
% Determine which rows of A are also in B as well as their corresponding locations in B.

[Lia, Locb] = ismember(A,B, 'rows')

% The lowest index to A(2,:) is B(1,:).
% Copyright 2015 The MathWorks, Inc.