how to switch the value of a boolean.

67 Ansichten (letzte 30 Tage)
Steven
Steven am 7 Sep. 2012
Hi, is there any function to do the following :
a = true;
b = someFunction(a)
==> b = false
b = sumeFunction(b)
==> b = true;
thank you.

Akzeptierte Antwort

Honglei Chen
Honglei Chen am 7 Sep. 2012
Bearbeitet: Honglei Chen am 7 Sep. 2012
b = ~a;
c = ~b;
or if you are looking for the functional form
b = not(a);
c = not(b);

Weitere Antworten (1)

James Tursa
James Tursa am 7 Sep. 2012
b = ~a;
c = ~b;

Kategorien

Mehr zu Simulink finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by