How to compare two hexadecimal number?

조회 수: 7 (최근 30일)
Balkar Singh
Balkar Singh 2020년 4월 17일
댓글: Balkar Singh 2020년 4월 17일
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
Stephen23
Stephen23 2020년 4월 17일
'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 2020년 4월 17일
Thanks sir.

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

답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by