Run a function when a GUI fig is opened?
古いコメントを表示
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
採用された回答
その他の回答 (1 件)
Jakob Sørensen
2012 年 5 月 4 日
0 投票
You can run it through the GUI opening function, or do you mean for any figure which is opened?
3 件のコメント
Campbell
2012 年 5 月 4 日
Walter Roberson
2012 年 5 月 4 日
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
2012 年 5 月 5 日
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...
カテゴリ
ヘルプ センター および File Exchange で Interactive Control and Callbacks についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!