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

    %% Symmetric Difference of Two Vectors in Specified Order  
% Use the |setOrder| argument to specify the ordering of the values in |C|.   

%% 
% Specify |'stable'| if you want the values in |C| to have the same order
% as |A| and |B|. 
A = [5 1 3 3 3]; B = [4 1 2];
[C,ia,ib] = setxor(A,B,'stable')  

%% 
% Alternatively, you can specify |'sorted'| order. 
[C,ia,ib] = setxor(A,B,'sorted')