Arduino Code line to Matlab

조회 수: 6 (최근 30일)
Denis Taiwo
Denis Taiwo 2016년 5월 1일
답변: Walter Roberson 2016년 5월 1일
I'm trying to convert an Arduino Source code line into Matlab manually but I'm not sure what the equivalent is.
The Arduino code is:
boolean x
Should I use logical or islogical or something else? Please reply soon.
  댓글 수: 1
CS Researcher
CS Researcher 2016년 5월 1일
Can you explain more? In what context do you want to use x?

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
Walter Roberson 2016년 5월 1일
That code is a type declaration. In some contexts it would reserve storage for a single boolean value. In some contexts it would also initialize the value to 0, but more typically it would not initialize the value. It is not a test for boolean values.
MATLAB does not declare types of variables ahead of time. The types of variables is determined by the type of the value assigned to the variable.
If the code assigns numeric constants to the variable, then use logical() around the constant, or use the named form. logical(0) is the same as false, and logical(1) is the same as true.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB Support Package for Arduino Hardware에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by