Reset button in Matlab GUI
42 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Matt
le 10 Mai 2013
Réponse apportée : Sittichai Ouamaimphuet
le 2 Mar 2022
Hello
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.
Thank you
Matt
0 commentaires
Réponse acceptée
David Sanchez
le 10 Mai 2013
In the reset button callback function just add the code to modify the boxes you need to reset.
set(handles.yourbox1,'string',num2str(0)); ...
once the user inserts the new values in the corresponding boxes, these will overwrite the old ones, if you code works as it should.
Plus de réponses (3)
David Sanchez
le 10 Mai 2013
to reset the plot use:
clf
type
help clf
for all the information you'll need
2 commentaires
Jonathan
le 21 Août 2013
Hi, I think what you want to do is:
cla(handles.Diagram1,'reset')
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.
Voir également
Catégories
En savoir plus sur Interactive Control and Callbacks dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!