%% Rows of Another Table and Their Location
% Create a table, A, of gender, age, and height for five people.

A = table(['M';'M';'F';'M';'F'],[27;52;31;46;35],[74;68;64;61;64],...
'VariableNames',{'Gender' 'Age' 'Height'},...
'RowNames',{'Ted' 'Fred' 'Betty' 'Bob' 'Judy'})

%
% Create another table, B, with rows in common with A.

B = table(['M';'F';'F';'F'],[47;31;35;23],[68;64;62;58],...
'VariableNames',{'Gender' 'Age' 'Height'},...
'RowNames',{'Joe' 'Meg' 'Beth' 'Amy'})

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

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

% Two rows that have the same values, but different names, are considered equal. The same data for Betty is found in B(2,:), which corresponds to Meg.
% Copyright 2015 The MathWorks, Inc.