GUIDATA updating "handles" in GUIDE with nested functions
Show older comments
Attached you can find a simple GUIDE with 2 push buttons:
Button #1 plots a sine graph.
Button #2 adds a "movable" vertical line to the graph.
Everything works fine and I can drag vertical line as desired (Thanks to Geoff and Walter)
What I'm trying to do now is to record x-position of vertical line (x_history) as I move it, and save this x_history to handles (via guidata) such that if I stop moving the line (mouse-up) and then resume moving the line (mouse-down and mouse-move) I can restore previous x_history from handles (via guidata).
The problem I'm facing is that every time I stop moving the line and go mouse-up, handles resets(!) the x_history field (removes the field), so I loose the previous record of x_history when I resume mouse-down and move the line.
What am I missing here?
Alborz
Accepted Answer
More Answers (0)
Categories
Find more on Labels and Annotations 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!