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

5 visualizzazioni (ultimi 30 giorni)
coratano
coratano il 20 Apr 2017
Modificato: Thorsten il 20 Apr 2017
I want to covert to .hex file to .m file. How can I do? I need your help.

Risposte (1)

Jan
Jan il 20 Apr 2017
Modificato: Thorsten il 20 Apr 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.

Categorie

Scopri di più su 앱 작성 in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!