필터 지우기
필터 지우기

Show Percentage of external Script in GUI

조회 수: 1 (최근 30일)
LUAB
LUAB 2018년 1월 18일
답변: Srikanth Sedimbi 2018년 1월 29일
Hello everybody!
Following problem: I created a GUI including a text field with the tag "percentage". In this GUI script (at the end of it) I added my external function. In a nutshell: When I press the "Calculate" button in my GUI, I want that my function gets called. That works fine, my function gets calucated without any problems. Following a simplified version of my function:
function myfun(input1)
for i=1:50
d = input1 * i;
percentage = i/50*100;
end
end
Now I want that the percentage of the calculation gets updated in my text field "percentage", so it shows the progress of the "for" command in my function. But I really don't know how I can updated a created string of a text field.
Thanks in advance! Paul

답변 (1개)

Srikanth Sedimbi
Srikanth Sedimbi 2018년 1월 29일
You can set the 'string' field of the edit text
set(handles.edit1,'string',num2str(percentage));

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by