what does x=6 means

1 次查看(过去 30 天)
x=6 y=7 disp(x&&y)
why is the answer 1
  1 个评论
Walter Roberson
Walter Roberson 2021-2-25
https://www.mathworks.com/help/matlab/ref/logicaloperatorsshortcircuit.html

请先登录,再进行评论。

采纳的回答

David Hill
David Hill 2021-2-25
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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by