How to manually break a for loop in matlab during execution so that the program get out of loop and continue the rest of the code after the for loop?
I define a for loop for 2000 iterations. Each iteration needs to perform an expensive function evaluation for a few minutes which give me a new point (x,y) to dynamically update my line plot. I am going to dynamically plot (x,y) points. Whenever the user decides not to continue with the for loop based on the shape of the dynamic plot, he /she should be able to break the loop and continue with next piece of codes comes after the loop. Note that Ctr+C just kills all the codes.
Best Answer