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

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 件のコメント

antonet
antonet 2012 年 7 月 6 日
thank you andrei. So my interpretation was correct. Am i right?
C.J. Harris
C.J. Harris 2012 年 7 月 6 日
This answer is not correct. Try both this statement and the original statement with inputs of a=2, b=3, 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 日

0 投票

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.

1 件のコメント

antonet
antonet 2012 年 7 月 6 日
thanks. this is actually what i was looking for

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeScope Variables and Generate Names についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by