How to get a push button to end a loop in a GUI?
Show older comments
I have created a GUI using GUIDE. The purpose is to plot an animation of a very simple projectile motion equation. I have edit text fields to enter the initial angle and velocity, drop downs to select the units, and two push buttons, one to plot and one to stop. Everything works well except for the stop button. I cannot seem to get it to interrupt the loop. I unchecked the interruptible box in the editor for the plot button. I don't have a very good grasp on the callback functions or hObjects or handles, and I would like a simple resolution. Can someone give me an idea of what I am doing wrong in the code below?
stop=get(handles.pushbutton4,'Value')
if stop==1
break;
end
This is homework, but adding stop functionality is not part of the assignment, this is just something I would like to do. We are only required to create a simple GUI; the animation is not even necessary.
Accepted Answer
More Answers (0)
Categories
Find more on Graphics Performance 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!