how to switch the value of a boolean.

80 次查看(过去 30 天)
Hi, is there any function to do the following :
a = true;
b = someFunction(a)
==> b = false
b = sumeFunction(b)
==> b = true;
thank you.

采纳的回答

Honglei Chen
Honglei Chen 2012-9-7
编辑:Honglei Chen 2012-9-7
b = ~a;
c = ~b;
or if you are looking for the functional form
b = not(a);
c = not(b);

更多回答(1 个)

James Tursa
James Tursa 2012-9-7

类别

Help CenterFile Exchange 中查找有关 Simulink 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by