www.gusucode.com > mbcdesign 工具箱 matlab 源码程序 > mbcdesign/@conbase/or.m
function c = or( c1, c2 ) %OR Logical OR of two constraints (union of two constraints) % % C = OR(C1,C2) is the union of the constraints C1 and C2, i.e., a point X % is in OR(C1,C2) if and only if it is inside C1 or it is inside C2. % % C1 and C2 must be the same size (as returned by GETSIZE) % % See also CONBASE/NOT, CONBASE/AND, CONBASE/XOR, CONBOOLEAN, GETSIZE. % Copyright 2000-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 = or( c2, c1 ); else c = conboolean( 'Or', c1, c2 ); end