What does ~ mean in the case of an if statement?

18 views (last 30 days)
This one appears to be ungoogleable due to the short length of the character.
Take for example...
if ~isempty([stats.Area])
Does this mean the equivalent of a 'not' function? Ie in this case it would be if the area array is not empty do something?
Thanks in advance.
TT

Accepted Answer

Image Analyst
Image Analyst on 18 Apr 2014
It means "not". Basically it's saying that if stats.Area is not empty (in other words, it has values), then do something.

More Answers (1)

Azzi Abdelmalek
Azzi Abdelmalek on 18 Apr 2014
It means not(your expression')
Exemple
a=[1 0]
~a
or
not(a)

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!