www.gusucode.com > mbcdesign 工具箱 matlab 源码程序 > mbcdesign/@conbase/xor.m
function c = xor( c1, c2 ) %XOR Logical EXCLUSIVE OR of two constraints (symmetric difference) % % C = XOR(C1,C2) is the symmetric difference of the constraints C1 and C2, % i.e., a point X is in XOR(C1,C2) if and only if it is not inside % AND(C1,C2) and it 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/OR, 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:conboolean:InvalidArgument')); end c = conboolean( 'Xor', c1, c2 );