how to switch the value of a boolean.

91 visualizaciones (últimos 30 días)
Steven
Steven el 7 de Sept. de 2012
Hi, is there any function to do the following :
a = true;
b = someFunction(a)
==> b = false
b = sumeFunction(b)
==> b = true;
thank you.

Respuesta aceptada

Honglei Chen
Honglei Chen el 7 de Sept. de 2012
Editada: Honglei Chen el 7 de Sept. de 2012
b = ~a;
c = ~b;
or if you are looking for the functional form
b = not(a);
c = not(b);

Más respuestas (1)

James Tursa
James Tursa el 7 de Sept. de 2012
b = ~a;
c = ~b;

Categorías

Más información sobre Geometric Transformation and Image Registration en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by