open up a raw binary file .rbf from quartus II

조회 수: 3 (최근 30일)
William
William 2012년 3월 28일
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

답변 (1개)

Walter Roberson
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

카테고리

Help CenterFile 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!

Translated by