Can I specify the numeric precision for each column when exporting the table data using writetable?
显示 更早的评论
I would like to specify the numeric precision for each column when exporting the table data using writetable function.
For example, in the following dataset, I would like to set A column to the last one digit and B column to the last three digits.
>> data = [(1:3)', rand(3,1)];
>> T = array2table(data,'VariableName',{'A','B'})
T =
A B
_ _______
1 0.81472
2 0.90579
3 0.12699
>> writetable(T,'mydata.csv','WriteRowNames',true)
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Tables 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!