bitand
Executes bitwise AND operation on the inputs, x and y. x and y must be finite, non-negative natural numbers or matrices with such elements. If either x or y are matrices, the result, R, will also be a matrix. If both x or y are matrices, their sizes must match.
Syntax
R = bitand(x, y)
Inputs
- x
- Valid values are finite, non-negative natural numbers or matrices with such elements. If both x or y are matrices, their sizes must match.
- y
- Valid values are finite, non-negative natural numbers or matrices with such elements. If both x or y are matrices, their sizes must match.
Outputs
- R
- Type: integer | mat
Examples
Non-negative integer inputs:
R = bitand(1,2)
R = 0
Matrix and non-negative integer
inputs:
R = bitand([3,2,1], 1)
R = [Matrix] 1 x 3
1 0 1
Matrix
inputs:
R = bitand([1,2,3;4,5,6;6,7,8],[2,3,4;1,2,3;5,6,7])
R = [Matrix] 3 x 3
0 2 0
0 0 2
4 6 0