Run a function when a GUI fig is opened?
Mostrar comentarios más antiguos
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
Respuesta aceptada
Más respuestas (1)
Jakob Sørensen
el 4 de Mayo de 2012
0 votos
You can run it through the GUI opening function, or do you mean for any figure which is opened?
3 comentarios
Campbell
el 4 de Mayo de 2012
Walter Roberson
el 4 de Mayo de 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
el 5 de Mayo de 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...
Categorías
Más información sobre Interactive Control and Callbacks en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!