Arduino Code line to Matlab
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Denis Taiwo
am 1 Mai 2016
Beantwortet: Walter Roberson
am 1 Mai 2016
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 Kommentar
Akzeptierte Antwort
Walter Roberson
am 1 Mai 2016
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 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu MATLAB Support Package for Arduino Hardware finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!