Can I specify the numeric precision for each column when exporting the table data using writetable?
Show older comments
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)
Accepted Answer
More Answers (0)
Categories
Find more on Tables 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!