open up a raw binary file .rbf from quartus II
3 views (last 30 days)
Show older comments
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 Comments
Answers (1)
Walter Roberson
on 28 Mar 2012
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 Comments
See Also
Categories
Find more on Low-Level File I/O in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!