bitand - Bitwise AND
Syntax
C = bitand(A, B)
Description
C = bitand(A, B) returns the bitwise
AND of arguments A and B, where A and B are
unsigned integers or arrays of unsigned integers.
Examples
Example 1
The five-bit binary representations of the integers 13 and 27 are 01101
and 11011, respectively. Performing a bitwise AND on these numbers yields
01001, or 9:
C = bitand(uint8(13), uint8(27))
C =
9Example 2
Create a truth table for a logical AND operation:
A = uint8([0 1; 0 1]);
B = uint8([0 0; 1 1]);
TT = bitand(A, B)
TT =
0 0
0 1See Also
bitcmp, bitget, bitmax, bitor, bitset, bitshift, bitxor
 | binary | | bitcmp |  |
Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
Get the Interactive Kit