| MATLAB Function Reference | Search  Help Desk |
| bitxor | Examples See Also |
C = bitxor(A,B)
C = bitxor(A,B)
returns the bit-wise XOR of the two arguments A and B. Both A and B must be integers. You can ensure this by using the ceil, fix, floor, and round functions.
The five-bit binary representations of the integers 13 and 27 are 01101 and 11011, respectively. Performing a bit-wise XOR on these numbers yields 10110, or 22.
C = bitxor(13,27)
C =
22
bitand Bit-wise AND
bitcmp Complement bits
bitget Get bit
bitmax Maximum floating-point integer
bitor Bit-wise OR
bitset Set bit
bitshift Bit-wise shift