How to switch to the opposite value of a logical type?
120 views (last 30 days)
Show older comments
Christopher Wong
on 15 Apr 2020
Answered: Walter Roberson
on 15 Apr 2020
Hello all, I'm wondering if theres some shorthand syntax to switch the current value of a logical to the opposite value. That is, if a = true, then a = false, otherwise a = true.
Yes, I realize I just described the obvious syntax: if (a), a = false; else, a = true; end, but I'm just wondering if MATLAB's got some function available that allows for more concise scripting.
0 Comments
Accepted Answer
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!