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

    %% Difference of Two Vectors  

%% 
% Define two vectors with values in common. 
A = [3 6 2 1 5 1 1]; 
B = [2 4 6];  

%% 
% Find the values in |A| that are not in |B|. 
C = setdiff(A,B)