How do you programmatically invoke model callbacks?
1 回表示 (過去 30 日間)
古いコメントを表示
For organizational purposes, I've defined my Simulink model's PreLoad callback expressions in the model explorer's callback pane directly, and NOT broken them out into a separate script file (so that all the necessary info is contained in the .mdl file). I'd also like to re-invoke the expressions IF the workspace has been cleared between the time the model was opened and the time it was run. So, I'd love a way to generically run the contents of the PreLoad pane without copying all of it into the InitFcn pane. Does anyone know of a way to programmatically run a model's callback function with a generic command?
I figured there would be a command similar to setting a model's simulation command to 'start', but I can't find a corresponding parameter for a model's callback.
0 件のコメント
採用された回答
Kaustubha Govind
2012 年 6 月 13 日
Kind of a hack, but this should work:
>> eval(get_param(bdroot, 'PreLoadFcn'))
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Model, Block, and Port Callbacks についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!