andElement-wise logical AND operation
and(A, B)A and B should be real numeric arrays with compatible sizes.1 if the corresponding elements of A and B are both non-zero, and is assigned logical 0 if otherwise.A && B and A & B.and(a,b) where a and b have the same sizes.a = randi(3,3,4) - 2
b = randi(3,3,4) - 2
and(a,b)
a =
-1.000 1.000 -1.000 -1.000
-1.000 1.000 0.000 0.000
0.000 1.000 0.000 0.000
b =
-1.000 0.000 0.000 1.000
1.000 0.000 -1.000 0.000
0.000 0.000 -1.000 1.000
ans =
1 0 0 1
1 0 0 0
0 0 0 0