How to display 1 decimal numbers in uitable?
9 次查看(过去 30 天)
显示 更早的评论
I am generating a table in a figure using uitable and I want to limit the number of decimal digits to 1.
I can't find an easy way for that.
0 个评论
回答(1 个)
Sufiyan
2023-7-26
Hi Alessandro,
You can follow the procedure shown in the below code to generate a table in the figure.
% sample data
data = [1.23456789, 4.56789123; 2.34567891, 5.67891234; 3.45678912, 6.78912345];
% Format the data to one decimal digit
formattedData = round(data, 1);
% Create a uitable
fig = uifigure;
uit = uitable(fig,'Data',formattedData);
Hope this helps!
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Migrate GUIDE Apps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!