comparison scripts/miscellaneous/xor.m @ 4030:22bd65326ec1

[project @ 2002-08-09 18:58:13 by jwe]
author jwe
date Fri, 09 Aug 2002 19:00:16 +0000
parents 38c61cbf086c
children 4c8a2e4e0717
comparison
equal deleted inserted replaced
4029:2cc57b6169cf 4030:22bd65326ec1
30 ## Adapted-By: jwe 30 ## Adapted-By: jwe
31 31
32 function z = xor (x, y) 32 function z = xor (x, y)
33 33
34 if (nargin == 2) 34 if (nargin == 2)
35 if (is_scalar (x) || is_scalar (y) || size (x) == size (y)) 35 if (isscalar (x) || isscalar (y) || size (x) == size (y))
36 z = logical ((x | y) - (x & y)); 36 z = logical ((x | y) - (x & y));
37 else 37 else
38 error ("xor: x and y must be of common size or scalars"); 38 error ("xor: x and y must be of common size or scalars");
39 endif 39 endif
40 else 40 else