Display number of digit is 2 in GUI Matlab

4 Ansichten (letzte 30 Tage)
Abed Nego Lubis
Abed Nego Lubis am 4 Jun. 2018
Beantwortet: Walter Roberson am 4 Jun. 2018
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

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 4 Jun. 2018
set(handles.text2, 'String', sprintf('%.2f', nlevel) );

Weitere Antworten (0)

Kategorien

Mehr zu Characters and Strings finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by