%% Members of Set and Indices to Values
% Create two vectors with values in common.

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

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

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

% The lowest index to A(3) is B(2), and A(4) is found in B(1).
% Copyright 2015 The MathWorks, Inc.