www.gusucode.com > mbcdesign 工具箱 matlab 源码程序 > mbcdesign/@conbase/and.m

    function c = and( c1, c2 )
%AND Logical AND of two constraints (intersection of two constraints)
%
%  C = AND(C1,C2) is the intersection of the constraints C1 and C2, i.e., a
%  point X is in AND(C1,C2) if and only if it is inside C1 and it is inside
%  C2.
%
%  C1 and C2 must be the have the same number of input factors (as returned by
%  NINPUTFACTORS).
%  
%  See also CONBASE/NOT, CONBASE/OR, CONBASE/OR, CONBOOLEAN,
%    CONBASE/NINPUTFACTORS. 

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


% check n input factors to constraints
if nFactors( c1 ) ~= nFactors( c2 ),
    error(message('mbc:conbase:InvalidArgument'));
end


if isa( c2, 'conboolean' ),
    c = and( c2, c1 );
else
    c = conboolean( 'And', c1, c2 );
end