How can I convert .hex file to .m file?
3 ビュー (過去 30 日間)
古いコメントを表示
I want to covert to .hex file to .m file. How can I do? I need your help.
0 件のコメント
回答 (1 件)
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.
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!