필터 지우기
필터 지우기

How to switch to the opposite value of a logical type?

조회 수: 117 (최근 30일)
Christopher Wong
Christopher Wong 2020년 4월 15일
답변: Walter Roberson 2020년 4월 15일
Hello all, I'm wondering if theres some shorthand syntax to switch the current value of a logical to the opposite value. That is, if a = true, then a = false, otherwise a = true.
Yes, I realize I just described the obvious syntax: if (a), a = false; else, a = true; end, but I'm just wondering if MATLAB's got some function available that allows for more concise scripting.

채택된 답변

Walter Roberson
Walter Roberson 2020년 4월 15일

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by