www.gusucode.com > mbc 工具箱 matlab 源码程序 > mbc/@guidarray/setdiff.m

    function [diff, index] = setdiff(obj, superset)
%SETDIFF setdiff for guidarray
%
%  [DIFF, INDEX] = SETDIFF(A, B)

%  Copyright 2000-2006 The MathWorks, Inc. and Ford Global Technologies, Inc.


% Which guids do the two arrays have in common?
commonValues = ismember(obj, superset);

% Remove and return
diff = fastindex(obj, ~commonValues);

% Is there an extra argument out
if nargout > 1
    index = getIndices(obj, diff);
end