Mercurial > octave-nkf
comparison scripts/miscellaneous/xor.m @ 6157:045038e0108a
[project @ 2006-11-13 22:22:53 by jwe]
author | jwe |
---|---|
date | Mon, 13 Nov 2006 22:22:54 +0000 |
parents | 34f96dd5441b |
children | 93c65f2a5668 |
comparison
equal
deleted
inserted
replaced
6156:a46f14cdbecd | 6157:045038e0108a |
---|---|
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 (isscalar (x) || isscalar (y) || size (x) == size (y)) | 35 if (isscalar (x) || isscalar (y) || size_equal (x, 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 |