GUIDE Interface: Do not populate when loading

1 次查看(过去 30 天)
When running a GUIDE interface data from previous sessions seem to be preloaded.
Instead only the bare interface should be displayed - without any data plotted and items selected.

回答(1 个)

Walter Roberson
Walter Roberson 2018-9-4
In the case where a GUIDE GUI has been made invisible but not closed, then running the .m will make the GUI visible again without changing its state.
Other than that, if you accidentally save the GUI inside GUIDE after you have run the code, then what is saved is the state at the time you request the save, which would include anything that the user had changed. In order to get around this problem, probably the best approach is to go back into GUIDE, clear the state of those fields, and then save again, so that the next time you run, you get the empty version. But another possibility is to add code to the OpenFcn callback to go in and reset the state before the user has a chance to interact with it. That can be a good approach sometimes, especially if you have added some kind of "reset" button for the user to be able to reuse the program without closing the GUI.

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by