www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/IntersectionofTwoTablesExample.m

    %% Intersection of Two Tables  

%% 
% Create two tables with rows in common. 
A = table([1:5]',categorical({'A';'B';'C';'D';'E'}),logical([0;1;0;1;0]))

%%
B = table([1:2:10]',categorical({'A';'C';'E';'G';'I'}),logical(zeros(5,1)))  

%% 
% Find the rows common to both |A| and |B|. 
C = intersect(A,B)