what does x=6 means

1 visualización (últimos 30 días)
mariam moutaz
mariam moutaz el 25 de Feb. de 2021
Editada: mariam moutaz el 25 de Feb. de 2021
x=6 y=7 disp(x&&y)
why is the answer 1
  1 comentario
Walter Roberson
Walter Roberson el 25 de Feb. de 2021
https://www.mathworks.com/help/matlab/ref/logicaloperatorsshortcircuit.html

Iniciar sesión para comentar.

Respuesta aceptada

David Hill
David Hill el 25 de Feb. de 2021
You can run the code and find out the answer. This is all about logical operations.
logical(6)&&logical(7);% by using && it converts 6 and 7 into their logical equivalent and AND them together
logical(-1);%logical of anything other than zero is 1

Más respuestas (0)

Categorías

Más información sobre Get Started with MATLAB en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by