Display number of digit is 2 in GUI Matlab

1 回表示 (過去 30 日間)
Abed Nego Lubis
Abed Nego Lubis 2018 年 6 月 4 日
回答済み: Walter Roberson 2018 年 6 月 4 日
Hi, i want display value of nlevel into my GUI, this is my code
global img;
nlevel= NoiseLevel(img);
set(handles.text2,'String', nlevel);
But its output long digit number decimal, how to reduce digit decimal, so it will only show 2 digit decimal? Thank you

採用された回答

Walter Roberson
Walter Roberson 2018 年 6 月 4 日
set(handles.text2, 'String', sprintf('%.2f', nlevel) );

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by