How can I run code just after GUI initialization?

I just want to run my code automatically after GUI has initialized. Any suggestion how can I do it?
Thanks in advance.
Andrew

4 件のコメント

Sara
Sara 2014 年 3 月 28 日
Which kind of code? A matlab code or an EXE? In any case, you can just call the code you want to run in the OpeningFcn.
Andrew
Andrew 2014 年 3 月 28 日
It is just a simple function (for example, evaluate 2 + 2), but I want do this automatically just after my gui uploaded.
Sara
Sara 2014 年 3 月 28 日
Then put the call to that function in the OpeningFcn (as Image Analyst has also suggested)
Andrew
Andrew 2014 年 3 月 28 日
Ok, thanks. I'll try it!

サインインしてコメントする。

回答 (1 件)

Image Analyst
Image Analyst 2014 年 3 月 28 日

0 投票

If it's something you built with GUIDE, then there is a function called yourApp_OpeningFcn(). That is where you're supposed to put most or all of your initialization stuff. If it's just a script where you're building your own GUI then just add the initialization code at the end of your script.

カテゴリ

ヘルプ センター および File ExchangeStartup and Shutdown についてさらに検索

質問済み:

2014 年 3 月 28 日

コメント済み:

2014 年 3 月 28 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by