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

    %% Intersection of Arrays of Different Classes and Shapes  

%% 
% Create a column vector character array. 
A = ['A';'B';'C'], class(A)  

%% 
% Create a 2-by-3 matrix containing elements of numeric type |double|. 
B = [65 66 67;68 69 70], class(B)  

%% 
% Find the values common to both |A| and |B|. 
[C,ia,ib] = intersect(A,B)  

%% 
% |intersect| interprets |B| as a character array and returns a character
% array, |C|. 
class(C)