Issue with load from text file with hex data

1 visualización (últimos 30 días)
Sandeep Acharya
Sandeep Acharya el 1 de Dic. de 2021
Respondida: Mathieu NOE el 1 de Dic. de 2021
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?

Respuestas (1)

Mathieu NOE
Mathieu NOE el 1 de Dic. de 2021
my 2 cents suggestion
>> a = readlines('textfilename.txt')
a =
"0xd080 "
>> b = hex2dec(char(a))
b =
53376

Categorías

Más información sobre Data Import and Export en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by