How to compare two hexadecimal number?

7 visualizaciones (últimos 30 días)
Balkar Singh
Balkar Singh el 17 de Abr. de 2020
Comentada: Balkar Singh el 17 de Abr. de 2020
Operands to the || and && operators must be convertible to logical scalar values.
I got this error when i try to excute the following code
if (dec2hex(watermark(1,i)) ==char('200E') && dec2hex(watermark(1,i+1))
==char('200E'))
  2 comentarios
Stephen23
Stephen23 el 17 de Abr. de 2020
'200E' is already a character vector, so char('200E') does absolutely nothing (it just returns '200E' unchanged).
Use strcmpi to compare the character vector '200E' against the output of dec2hex.
Balkar Singh
Balkar Singh el 17 de Abr. de 2020
Thanks sir.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

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

Community Treasure Hunt

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

Start Hunting!

Translated by