open up a raw binary file .rbf from quartus II
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (1)
Walter Roberson
le 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 commentaires
Voir également
Catégories
En savoir plus sur Standard File Formats dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!