How to stop (an infinite loop) / the execution of my matlab code via app designer?
56 views (last 30 days)
Hey, i got an infinite while loop in my script and i want to get out of it using matlab app.designer, therefore i created a start button to run my script which is working perfectly fine and a stop button to stop it whenever the user wants to from the designer.
I couldnt figure how to programme the stop button. a solution can be the change of the value of the while loop(while true ==> while false) from the designer when clicking on the stop button. how can i do it?
i appreciate every help and thanks in advance!
More Answers (1)
Rik on 30 Aug 2022
You need to use the callback function from your stop button to edit a value. This is the general structure:
% Do things
% Process any callbacks in the queue. This will also update the value
% of app.StopButtonClicked if the stop button callback has run.