How to manipulate a handle with a function
Show older comments
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.
Accepted Answer
More Answers (0)
Categories
Find more on Interactive Control and Callbacks in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!