Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.



Using textscan with exponential notation
Posted:
Aug 4, 2014 1:24 PM


If I have a line of text formatted as follows:
3.3225254e+01 4.4877079e+01 4.6426502e+01
How can I use textscan() to pull these numbers out with the same precision?
I've read the text as a string into the variable coord_row, and I've tried this
coord_row = textscan(coord_row,'%f %f %f');
I end up with less precision than I am looking for. I've also tried
coord_row = textscan(A{i},'%9.7f %9.7f %9.7f');
Which lops off the exponential notation.
I want to end up doing some math to the coordinates, and writing back to a file with the same format and precision as the original coordinates I read in. Any help would be greatly appreciated.
Thanks, Connor



