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

5 次查看(过去 30 天)
coratano
coratano 2017-4-20
编辑: Thorsten 2017-4-20
I want to covert to .hex file to .m file. How can I do? I need your help.

回答(1 个)

Jan
Jan 2017-4-20
编辑:Thorsten 2017-4-20
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.

类别

Help CenterFile Exchange 中查找有关 앱 작성 的更多信息

Community Treasure Hunt

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

Start Hunting!