xor
Find logical exclusive-OR
Syntax
Description
C =xor(
performs a logical exclusive-OR of arraysA
,B
)A
andB
and returns an array containing elements set to either logical 1 (true
) or logical 0 (false
). An element of the output array is set to logical 1 (true
) ifA
orB
, but not both, contains a nonzero element at that same array location. Otherwise, the array element is set to 0.
For bit-wise logical XOR operations, seebitxor
.