Clear Filters
Clear Filters

GUIDE Interface: Do not populate when loading

1 view (last 30 days)
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.

Answers (1)

Walter Roberson
Walter Roberson on 4 Sep 2018
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.

Categories

Find more on Migrate GUIDE Apps 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!