FORTRAN Binaries

조회 수: 9 (최근 30일)
William
William 2012년 1월 25일
I am reading a binary file that was made in FORTRAN.
I am using fread(fid,'int32',0,'b')
EDIT: I caught the obvious...that I am reading in integers, reading them in as float32 of gets me where I want to be.
The file should contain two 'data objects' of size 365*192*94.
I thought I had appropriately identified the 4 byte tags that FORTRAN puts in the bin files.
The data I have is this:
26350080 1.1324e+09 1.1324e+09 ....... 1.1324e+09 1.1324e+09 26350080 26350080 1.0863e+09 1.0865e+09 ....... 1.0861e+09 1.0860e+09 26350080
So I thought I had correctly identified the 'tags' as the number 26350080, and the data objects have values of about 1.0e+09, with 365*192*94 entries. So, as far as the number of data entries...it seems to line up perfectly.
I thought I was successful...but am now told that the number should not be on the order of e+09, but rather on the order of e+00 to e+01.
not sure what to do....if I change to like int8, I get smaller numbers but I end up with way to many entries and don't get the 'tags' that line up so well.
Any ideas?
Will

답변 (1개)

William
William 2012년 1월 25일
changed the format from int32 to float32...I realize this is pretty obvious.

카테고리

Help CenterFile Exchange에서 Fortran with MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by