www.gusucode.com > mbctools 工具箱 matlab 源码程序 > mbctools/@sweepset/eq.m

    function ind = eq(A,B)
%EQ Equal-to operator for sweepsets
% 
%  EQ(A, B) implements the logical operation A==B.  A must be a sweepset
%  and B can be a sweepset or double.  The operation returns a
%  (NUMRECORDS-by-1) logical vector containing true values where any
%  variable in a record in A is equal to the corresponding value in B.

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


switch class(B)
    case 'sweepset'
        if all(size(A)==size(B))
            ind = any(A.data == B.data,2);
        else
            ind = false(numRecords(A), 1);
        end
    case 'double'
        ind = any(A.data == B,2);
    otherwise
        ind = false(numRecords(A), 1);
end