Here is the notepad file which I am trying to import to Matlab.
0.0833333 -1.42876e-005 -6.8571e-024
0.166667 -2.86315e-005 3.59222e-023
0.25 -4.30324e-005 -3.44176e-023
0.333333 -5.7491e-005 7.89197e-023
0.416667 -7.2008e-005 2.58657e-022
0.5 -8.65841e-005 2.26725e-023
0.583333 -0.00010122 2.88135e-022
0.666667 -0.000115916 -3.11975e-022
0.75 -0.000130674 1.65466e-022
0.833333 -0.000145494 1.95335e-022
The Matlab Code that I am using to import it is
fid = fopen('ouput.out', 'r');
FC = textscan(fid, '%f %f %f', 10);
fclose(fid);
celldisp(FC);
Matlab Output
FC{1} =
0.0833
0.1667
0.2500
0.3333
0.4167
0.5000
0.5833
0.6667
0.7500
0.8333
FC{2} =
1.0e-03 *
-0.0143
-0.0286
-0.0430
-0.0575
-0.0720
-0.0866
-0.1012
-0.1159
-0.1307
-0.1455
FC{3} =
1.0e-21 *
-0.0069
0.0359
-0.0344
0.0789
0.2587
0.0227
0.2881
-0.3120
0.1655
0.1953
As can be seen, I am losing out on the precision as Matlab output restricts to only 4 digits after the decimal. How do I sort this out to direct the Matlab output as it is in the Notepad file?
help formatfor how to choose between floating and fixed point output formats. Also, an internet search will explain the difference between the two. Look for the difference between %f, %g, and %e when printing. – AnonSubmitter85 Jul 08 '15 at 17:08