How to control the precison of a table that has varying number of columns in writetable?
2 views (last 30 days)
Show older comments
This is my table:
T1 = table(A, EXP, CRU, STA, CAS, NIS, SAM, ... );
If the # of columns is set, I would be able to specify the precision of each column as something like this:
formatSpec = '%s %d %2.1f %s %10.4f %8.3f\n';
and then use the below command to write the table to a txt file:
writetable(T1, 'Table1.txt', formatSpec, 'delimiter','\t');
The problem is that my table can have varying number of columns. If a column only contains NaNs, it will be dropped using the below command, for example:
T1.EXP = [];
In this case, how should I specify the formatSpec?
Many thanks!
0 Comments
Answers (0)
See Also
Categories
Find more on String Parsing 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!