Show Percentage of external Script in GUI

2 次查看(过去 30 天)
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 中查找有关 Environment and Settings 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by