Run a function when a GUI fig is opened?
Ältere Kommentare anzeigen
Is it possible to automatically run a function when a GUI (fig) is opened? I.e. is there a property of the fig class that would do this? I would like to construct the controls differently depending on the environment, e.g. Windows vs. Linux, which specific files are in the system search path, etc. Thanks, Campbell
Akzeptierte Antwort
Weitere Antworten (1)
Jakob Sørensen
am 4 Mai 2012
0 Stimmen
You can run it through the GUI opening function, or do you mean for any figure which is opened?
3 Kommentare
Campbell
am 4 Mai 2012
Walter Roberson
am 4 Mai 2012
Is this for GUIDE? GUIDE .fig files are not designed to be used independently of the .m file of the same name. The .m file contains a GUI open function, which is the place that you would normally put a call to the routine to make OS-specific adjustments.
.fig files that contain code are not designed to run any function when they are opened.
Jakob Sørensen
am 5 Mai 2012
Normally what you do is make a GUI (using Guide), which can be run by typing its name in the command prompt (assuming that you're in the correct folder). Once in the GUI, you're free to make controls for almost everything...
Kategorien
Mehr zu Interactive Control and Callbacks finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!