How to keep loop stopped in the gui
Show older comments
Hey, so my problem is my function stops when i press the stop button on the gui, but it doesn't stay stopped. It will continue on to the next value in the for loop. The following code is how i'm trying to stop the function:
for i = 1:length(DRAW)
drawnow()
stop_state = get(handles.STOP,'Value');
if stop_state
kill = 1
else
kill = 0
end
[out_Params, Inter_params, out_J, time, FLAG] = RECIRC_FO_design_GUI(sol_props, ...
INLET_PARAMS, FEED_PARAMS, DRAW_PARAMS, SYSTEM_PARAMS, MEM_PARAMS, MW_salt, DRAW(i), kill);
if kill
kill = 1;
break;
end
end
I put a condition in the function itself that would stop it, but when i check the value after hitting the stop button, the value is still 0 instead of 1. I've looked at the previously answered question regarding this topic, and they work just the function won't stay stopped. the stop button is just a push button that when pressed sets it's handle value to 1.
Accepted Answer
More Answers (0)
Categories
Find more on Desktop 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!