TEXTSCAN Reads from Fortran Output - Precision Problem
Show older comments
I am reading the output data from a fortran generated file which is in the form
720. 2.715E+12 4.437E+10
730. 2.342E+12 3.849E+10
.
.
.
2700. 5.282E+01 1.852E+03
2710. 4.882E+01 9.521E+03
when I use the texscan as:
FormatSpec='%f %f %f'
cell=textscan(fileID,FormatSpec,N)
First column loads with no problem but MATLAB stores the last lines values for 2nd and 3rd column as zero. for instance for the 2nd column output is:
1.0e+12 *
2.7150
2.3420
.
.
.
0.0000
0.0000
and similar output for the 3rd column. Is there any way to tell MATLAB to store the data as they are(i.e. with the same format as they are read).
Thanks
The fortran format of the data for 2nd and 3rd columns is "1P5E9.2".
Accepted Answer
More Answers (0)
Categories
Find more on Fortran with MATLAB 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!