How to use a boolean?
382 次查看(过去 30 天)
显示 更早的评论
For the following code, I'm trying to say that if the rocket is turned on, the thrust is 1950 lb and if the rocket is turned off, the thrust is 0 lb. I have raw-coded it but I would prefer it as a function with boolean operators.
rcktOn = [0 1];
T = rcktOn*1950;
T_off = T(1)
T_on = T(2)
Is there any simple way to use booleans to convey the above information?
1 个评论
Guillaume
2019-2-28
Note that booleans are call logical in matlab, and have values true or false. logical is implicitly convertible to double.
采纳的回答
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!