Borrar filtros
Borrar filtros

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

1 visualización (últimos 30 días)
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”

Respuesta aceptada

Andrei Bobrov
Andrei Bobrov el 6 de Jul. de 2012
Editada: Andrei Bobrov el 6 de Jul. de 2012
isequalwithequalnans(a,b) | isequalwithequalnans(a,c)
  4 comentarios
Andrei Bobrov
Andrei Bobrov el 6 de Jul. de 2012
Sorry! I agree with Chris, thank you Chris. I corrected my answer.
C.J. Harris
C.J. Harris el 6 de Jul. de 2012
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.

Iniciar sesión para comentar.

Más respuestas (1)

C.J. Harris
C.J. Harris el 6 de Jul. de 2012
Editada: C.J. Harris el 6 de Jul. de 2012
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.

Categorías

Más información sobre Logical en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by