How to switch to the opposite value of a logical type?

166 vues (au cours des 30 derniers jours)
Christopher Wong
Christopher Wong le 15 Avr 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.

Réponse acceptée

Walter Roberson
Walter Roberson le 15 Avr 2020

Plus de réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Produits


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by