Display number of digit is 2 in GUI Matlab

조회 수: 2 (최근 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 CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by