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

    function c = and(con1,con2)
%AND combine constraints
%
%  c = c1 & c2

%  Copyright 2008 The MathWorks, Inc.

if isa(con1,'conswitch') && isa(con2,'conswitch') && ...
        isequal(getInputFactors(con1),getInputFactors(con2)) && ...
        isequal(con1.OpPoints,con2.OpPoints)
    c = con1;
    for i=1:length(c.ConList)
        % combine local constraints into conboolean
        c.ConList{i} = conboolean('and',c.ConList{i},con2.ConList{i});
    end
else
    % produce a standard conboolean for who con object
    c = conboolean('and',con1,con2);
end