pass a function in a .m file as a parameter to StartFcn callback property.

7 ビュー (過去 30 日間)
madhu
madhu 2012 年 5 月 23 日
I have a .m file in which there are number of functions. Now out of those functions i want one particular function to execute automatically when the simulation starts. For that to happen i found out that StartFcn property has to be used. But i do not know how to pass that particular function to StartFcn property.
Kindly help.

採用された回答

Kaustubha Govind
Kaustubha Govind 2012 年 5 月 23 日
You can either do it by command-line:
>> set_param('modelname', 'StartFcn', 'matlabfcntorun')
Or to do it interactively, right click on the model, select "Model Properties" and in the window that opens, select the Callbacks tab and then choose StartFcn in the right panel. On the corresponding left panel, you can enter whatever MATLAB code you want to run.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeModel, Block, and Port Callbacks についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by