io format specifier question
marco restelli
mrestelli at gmail.com
Tue Jul 1 13:02:36 CDT 2008
Dear list members,
I need to read an ASCII file containing floating point numbers as
0.112977-141
which stands for 0.112977E-141 (i.e., the E is omitted). The point is,
fscanf(fp,'%e') treats this as two numbers, and using
line = fgets(fp);
x = str2num(line);
I get x = 0.112977 - 141 = -140.89
Is there a way to make octave understand this format?
(Notice that writing 0.112977-141 in place of 0.112977E-141 is
standard conforming behavior for FORTRAN programs)
Thank you,
Marco
More information about the Help-octave
mailing list