What does a "~" mean in the following code

A newbie (me) needs to understand a syntax I can't find in the documentation.
if ~isempty(E)
B=[A
E'*S];
end;
What does the ~ (tilde) mean or do prior to the isempty(E)?

댓글 수: 2

Todd Flanagan
Todd Flanagan 2011년 1월 20일
Andreas say, "I found it. ~ indicates not.
Thx anyway"
Todd Flanagan
Todd Flanagan 2011년 1월 20일
Hi Andreas, I moved your answer into a comment on your original question.

댓글을 달려면 로그인하십시오.

 채택된 답변

Kenneth Eaton
Kenneth Eaton 2011년 1월 20일

7 개 추천

This is the logical NOT operator, so ~isempty(E) will evaluate to true when E is not empty.

추가 답변 (2개)

Doug Hull
Doug Hull 2011년 1월 20일

9 개 추천

~ means 'not'
doc punct
At the command line will tell you other uses for ~ and the punctuation marks.
Luna
Luna 2024년 4월 18일

0 개 추천

  1. For what values of the variable a will the following code print 'Goodbye Mapua'?
  2. if a < 7 || a >= 4
  3. disp('Hello Mapua ')
  4. else
  5. disp('Goodbye Mapua ')
  6. end

카테고리

도움말 센터File Exchange에서 Matrix Indexing에 대해 자세히 알아보기

제품

태그

질문:

2011년 1월 20일

답변:

2024년 4월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by