How to manipulate a handle with a function
이전 댓글 표시
Dear all, I do not know exactly how to describe my problem, but maybe you know any help.
I have a GUI. In this GUI I have a Text which I want to manipulate during my calculations.
So what I do is, after klicking a Start-Button, I run a simulation in another function. This one takes a long time. Therefor I would like to give Status-Updates.
How it looks right now:
% --- Executes on button press in startOptimization.
function startOptimization_Callback(hObject, eventdata, handles)
% hObject handle to startOptimization (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
button_state = get(hObject,'Value');
if button_state == get(hObject,'Max')
% Toggle button is pressed-take appropriate action
switch get(handles.calcType.SelectedObject,'Tag') % Get Tag of selected object.
case 'carfixed'
.....
[x, handles.y, handles.z, ~, b] = optimizeTrips(item,lPinput,handles.c,1);
.... optimizeTrips is my function which now has a lot of "for"
function [hit, lT, kmD, ran, perc] = optimizeTrips(i,LP,f,ep)
for w=1:21
....
end
end
So I would like to update my handles.textStatus with every "w" but I don't know how to transfer this data from the one function to my GUI.
I appreciate any help. Even if you just tell me how to google that stuff :D
Thank you very much.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!