xor

Purpose

Exclusive or.

Synopsis

C = xor(A,B)

Description

C = xor(A,B) is the symmetric difference of the nonzero structures of A and B, that is, C(i,j) is one if A(i,j) or B(i,j), but not both, is nonzero.

Examples

To see where either S or T has a nonzero element and the other matrix does not,

spy(xor(S,T))

See Also

&, |, all, any, find

(c) Copyright 1994 by The MathWorks, Inc.