%% Difference of Two Vectors and Indices to Different Values
% 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 as well as the index vector ia, such that C = A(ia).

[C,ia] = setdiff(A,B)

% Copyright 2012 The MathWorks, Inc.