How to control the precison of a table that has varying number of columns in writetable?
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 String Parsing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!