필터 지우기
필터 지우기

How to display 1 decimal numbers in uitable?

조회 수: 1 (최근 30일)
Alessandro Travaglini
Alessandro Travaglini 2022년 10월 13일
답변: Sufiyan 2023년 7월 26일
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.

답변 (1개)

Sufiyan
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);
You can refer to the uitable to know more about the function.
Hope this helps!

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by