In MATLAB, I am trying to write out to a direct access binary file, a single one-dimensional arry (dd3(793)) so that it can be read by a colleague using a FORTRAN90 program via Visual FORTRAN on a Windows 7 Platform.
To write the file in MATLAB, I use the following:
fileID3=fopen(Name.bin','w+','l');
I have also used 'w', 'a+' and 'a' for the permission and 'a' for the format
and then:
fwrite(fileID3,dd3,'double'); or 'real*8' for the format.
In the FORTRAN PROGRAM, we do the following a:
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&real dd3(793)open(unit=10, file='Name.bim','status='old',access='direct',recl=793*8)read(10,rec=1)dd3&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
when I try to print out values for dd3, all get is garbage for the various options.
Any idea what I migh be doing wong?
Steve
Best Answer