Signifcant numbers set in a table
Show older comments
Can anyone please give an advice how to set the significant numbers only on the table numerical fields?
Code:
clc;
clear all;
xID = ['1';'2';'3';'4';'5'];
xName = {'Sun';'Moon';'Jupiter';'Earth';'Venus'};
I1 = [1.1112;9.2311245;3.341145;6.341122;54.211155];
I2 = [1.1199999;1.1211345;1.881188;1.5781188;1.63711777];
I3 = [6.232114;5.1211223654;4.452112272;3.5711235;2.62112247];
mt = table(xID, xName, I1, I2, I3);
table_data=cellfun(@(x) sprintf('%0.2f', x), mt), 'UniformOutput',0);
4 Comments
dpb
on 1 Feb 2021
If just display, I often use
format bank, format compact
for table data...it has pluses and minuses--integers are also displayed with the two decimal places being the most annoying.
There really is no good way to control display formatting in MATLAB command window, unfortunately.
dpb
on 1 Feb 2021
What, specifically, do you mean by " using matlab report"?
Accepted Answer
More Answers (0)
Categories
Find more on Logical 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!