how to switch the value of a boolean.

82 visualizzazioni (ultimi 30 giorni)
Steven
Steven il 7 Set 2012
Hi, is there any function to do the following :
a = true;
b = someFunction(a)
==> b = false
b = sumeFunction(b)
==> b = true;
thank you.

Risposta accettata

Honglei Chen
Honglei Chen il 7 Set 2012
Modificato: Honglei Chen il 7 Set 2012
b = ~a;
c = ~b;
or if you are looking for the functional form
b = not(a);
c = not(b);

Più risposte (1)

James Tursa
James Tursa il 7 Set 2012
b = ~a;
c = ~b;

Categorie

Scopri di più su Simulink in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by