Logical Vectors and &
20 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Mark Tenorio
el 11 de Mzo. de 2018
Comentada: Mark Tenorio
el 11 de Mzo. de 2018
I have two logical vectors:
A = [0 1 1 1 1 0 0] B = [0 0 0 0 0 0 0]
C = A & B % C = [0 0 0 0 0 0 0]
Can someone explain to me why C = [0 0 0 0 0 0 0].
0 comentarios
Respuesta aceptada
John D'Errico
el 11 de Mzo. de 2018
The & operator works on the elements of the two variables element-wise.
Since All elements of B are 0 (false) and it is true that if you and anything with false, then the result is uniformly false.
What else would you have expected?
Más respuestas (0)
Ver también
Categorías
Más información sobre Whos en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!