Problems with xlsread & xlswrite, and rounding & significant figures
1 view (last 30 days)
Show older comments
I have a slight problem with xlsread and a bigger problem with xlswrite. When I import a file I use...
[data, txt, raw] = xlsread('filename.xls');
and I get the warning...
Warning: Could not start Excel server for import, 'basic' mode will be used.
Refer to HELP XLSREAD for more information.
> In xlsread at 175
In Senspod_Data_02 at 5
.
.
Then at the end after I manipulate the data and try to create an XLS file...
Warning: Could not start Excel server for export.
XLSWRITE will attempt to write file in CSV format.
> In xlswrite at 164
In Senspod_Data_02 at 86
.
.
Fortunately, the data imports fine and I can manipulate it, though when I export, it does so as a CSV. When I open the CSV, the values are all in separate cells, but some values are rounded, and others are missing significant figures... I use 'format long because I need all of the significant figures)
1.552574520000000 (as 1.0e+5 *) in excel-csv is as 155260 (and this is supposed to be a time code)
another example is with my GPS coordinate columns... my m-file produces 0.000422188790000 (also as 1.0e+5 *), and when I open the CSV, the value is 42.219.
my output command looks like...
xlswrite('filename.xls',data);
How can I get all of the significant figures that I need in my final xls file?
Thanks.
-Adam-
4 Comments
Matt Tearle
on 23 May 2011
And, similarly, [apologies for the dumb question, but...] are the values actually truncated, or is that just Excel's display setting?
the cyclist
on 23 May 2011
I second Matt Tearle's comment. You can adjust the number of significant figures being displayed, using the Format menu. (You might also have it in a toolbar.)
Answers (0)
See Also
Categories
Find more on Use COM Objects in 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!