Display number of digit is 2 in GUI Matlab

2 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Axis Labels 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by