How can I convert .hex file to .m file?

6 visualizaciones (últimos 30 días)
coratano
coratano el 20 de Abr. de 2017
Editada: Thorsten el 20 de Abr. de 2017
I want to covert to .hex file to .m file. How can I do? I need your help.

Respuestas (1)

Jan
Jan el 20 de Abr. de 2017
Editada: Thorsten el 20 de Abr. de 2017
It depends on the contents of the hex file and what you want to achieve as M-file. Actually .hex files contain binary values in hex format. e.g. "4A 61 6E 20 53 69 6D 6F 6E" or the same without spaced. But this cannot be converted to an M-file directly. The hex code is only useful to transport binary data through a connection which allow 7 bits only.
Perhaps your hex files have a more complicated inner structure, e.g. https://en.wikipedia.org/wiki/Intel_HEX . Then please explain what you mean by ".hex file" and what you expect after a conversion to an M-file. Maybe reading the data by fscanf(fid, '%2x') is sufficient already to import the data as uint8 values.

Categorías

Más información sobre 앱 작성 en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!