open up a raw binary file .rbf from quartus II
3 次查看(过去 30 天)
显示 更早的评论
Greetings,
I have a raw binary file generated from quartus II 11.1 that I need to open in Matlab and display in Hex. How can I do this I tried using fopen()
fid = fopen('VCS_5405.rbf','r','l')
And.. I get 3 returned. What's going on with that??
Thanks
0 个评论
回答(1 个)
Walter Roberson
2012-3-28
A return value of 3 from that statement would be typical. The value returned from fopen() is a File Identifier, which is a number used to identify which file you are referring to when you use other I/O statements.
After your fopen() statement, you will need fread() statements to read the data from the file, and you will need output statements such as fprintf() to display the file content as hex.
For example,
fid = fopen('VCS_5405.rbf','r','l');
while true
this16 = fread(fid, 16, '*uint8');
if isempty(this16); break; end %end of file
thisfmt = [repmat('%02X ', 1, length(this16)-1), '%02X\n'];
fprintf(1, thisfmt, this16);
end
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Low-Level File I/O 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!