how to switch the value of a boolean.

조회 수: 89 (최근 30일)
Steven
Steven 2012년 9월 7일
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에서 Geometric Transformation and Image Registration에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by