Clear handle variables in GUI

I made a GUI with user inputs stored in the handle structure. When I close the GUI and re-run it, the new variables that I stored in the handle (from the callbacks, not the createFcns) is still there, and retains the values from the last run. How do I fix this?

3 comentarios

Adam
Adam el 23 de Jun. de 2017
Did you save the figure that you actually ran over the top of the GUIDE .fig file?
Christina Chen
Christina Chen el 23 de Jun. de 2017
Yes. I had saved the figure. How can I clear the save from the .m?
Jan
Jan el 23 de Jun. de 2017
The data are not saved in the M-files, but in the figure. You can restore the former version of the fig file using the "recent versions" backup system, if you work under Windows.

Iniciar sesión para comentar.

Respuestas (1)

Akhilesh Thakur
Akhilesh Thakur el 31 de Jul. de 2017

0 votos

When you close it use this delete(hObject); or delete(handles); this should be put at bottom of closerequestfucntion

Categorías

Más información sobre Creating, Deleting, and Querying Graphics Objects en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 23 de Jun. de 2017

Respondida:

el 31 de Jul. de 2017

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by