Issue with load from text file with hex data

조회 수: 6 (최근 30일)
Sandeep Acharya
Sandeep Acharya 2021년 12월 1일
답변: Mathieu NOE 2021년 12월 1일
Create a text file with 0xd080 in the text file
use the command load('textfilename')
The value returned is 57472 however the actual value should have been 53376
Even if i use load('textfilename','-ascii') also does not solve the problem. Still invalid data is returned.
How to fix this problem?

답변 (1개)

Mathieu NOE
Mathieu NOE 2021년 12월 1일
my 2 cents suggestion
>> a = readlines('textfilename.txt')
a =
"0xd080 "
>> b = hex2dec(char(a))
b =
53376

카테고리

Help CenterFile Exchange에서 Data Import and Export에 대해 자세히 알아보기

태그

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by