Reset button in Matlab GUI
94 views (last 30 days)
Show older comments
Answered: Sittichai Ouamaimphuet on 2 Mar 2022
I am working with Mat lab GUI and it works. But I need to add a reset button so that that when the user wants to input other parameters, it clear all the input data and figure of the previous result.
Any idea please how to implement this.
In the reset button callback function just add the code to modify the boxes you need to reset.
once the user inserts the new values in the corresponding boxes, these will overwrite the old ones, if you code works as it should.
More Answers (3)
to reset the plot use:
for all the information you'll need
Jonathan on 21 Aug 2013
Hi, I think what you want to do is:
If Diagram1 is the tag to the axes object in your gui. I found clf didn't work as expected so changed to cla and upon pushing the reset button in my gui it cleared the figure to be blank.
Find more on Specifying Target for Graphics Output 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!