필터 지우기
필터 지우기

verification of the intepretation of a simple code that contains "isequalwithequalnans"

조회 수: 1 (최근 30일)
Could you please verify the interpretation of the code
if ~(isequalwithequalnans(a, b) ==1 | isequalwithequalnans(a, c) ==1)
'not ok'
End
My interpretation is the following
If (a and b) are not equal OR (a and c) are not equal then
“Not ok”

채택된 답변

Andrei Bobrov
Andrei Bobrov 2012년 7월 6일
편집: Andrei Bobrov 2012년 7월 6일
isequalwithequalnans(a,b) | isequalwithequalnans(a,c)
  댓글 수: 4
Andrei Bobrov
Andrei Bobrov 2012년 7월 6일
Sorry! I agree with Chris, thank you Chris. I corrected my answer.
C.J. Harris
C.J. Harris 2012년 7월 6일
Maybe I'm missing something here, but this is still not correct. Notice the NOT symbol (~) in the original statement. Your answer is the opposite of the correct answer.

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

추가 답변 (1개)

C.J. Harris
C.J. Harris 2012년 7월 6일
편집: C.J. Harris 2012년 7월 6일
No, that interpretation is NOT correct.
The statement says if BOTH b and c are different to a then 'Not ok'. Or in other words it is 'ok' as long as either b OR c is equal to a.

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by