Skip to content

xor

Element-wise logical XOR (exclusive or).

C = xor(A, B)

Returns true where exactly one of A and B is true, false otherwise.

xor([1 0 1], [1 1 0]) % [0 1 1]
  • and — Element-wise logical AND (function form of &).
  • or — Element-wise logical OR (function form of |).
  • bitxor — Bitwise XOR of two integers.