Issue with load from text file with hex data

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?

Antworten (1)

Mathieu NOE
Mathieu NOE am 1 Dez. 2021

0 Stimmen

my 2 cents suggestion
>> a = readlines('textfilename.txt')
a =
"0xd080 "
>> b = hex2dec(char(a))
b =
53376

Kategorien

Mehr zu Data Import and Export finden Sie in Hilfe-Center und File Exchange

Produkte

Version

R2021b

Gefragt:

am 1 Dez. 2021

Beantwortet:

am 1 Dez. 2021

Community Treasure Hunt

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

Start Hunting!

Translated by