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!