MATLAB® encodes negative integers using two's complement. For example, to find the two's complement representation of -5, you take the bit pattern of the positive version of the number (00000101), swap each bit (11111010), and then add 1 to the result (11111011).
Therefore, the bit-wise XOR of -5 (11111011) and 6 (00000110) is -3 (11111101).
Input values, specified as scalars, vectors, matrices, or multidimensional
arrays. Inputs A and B must
either be the same size or have sizes that are compatible (for example, A is
an M-by-N matrix and B is
a scalar or 1-by-N row vector).
For more information, see Compatible Array Sizes for Basic Operations. A and B also
must be the same data type unless one is a scalar double.
If A and B are
double arrays, and assumedtype is not specified,
then MATLAB® treats A and B as
unsigned 64-bit integers.
If assumedtype is specified, then
all elements in A and B must
have integer values within the range of assumedtype.
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window.
Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: United States.
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.