According to the documentation, "Fewer than 16 characters are padded on the right with zeros" so it must be an endian thing.
Bet that causes a lot of bugs. What function gets the expected result of F = 15?

 채택된 답변

Stephen23
Stephen23 2019년 2월 7일
편집: Stephen23 2019년 2월 7일

0 개 추천

Try hex2dec instead:
>> hex2dec('F')
ans = 15
"What function gets the expected result of F = 15?"
You can easily find these functions yourself: clicking up one level from hex2num in the contents takes you to this page, where all such conversion functions are listed:
"Why does hex2num('F') equal -3.1050e+231?...so it must be an endian thing."
Nope. As the documentation states, it is because the input is considered to be an IEEE formated number:

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

제품

릴리스

R2018b

질문:

2019년 2월 7일

편집:

2019년 2월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by