Running model callbacks in model workspace

4 ビュー (過去 30 日間)
Rey
Rey 2013 年 5 月 13 日
Noticed that model callbacks such as PostLoadFcn, StartFcn etc run in base workspace, and they cannot access variables defined in model workspace unless they are evalin'ed in model workspace. Is there a way to change this behaviour and tell the model to evaluate the expressions of its model callbacks in the model workspace instead?

回答 (1 件)

Ryan G
Ryan G 2013 年 5 月 13 日
I don't believe you can change the default behavior here. How much extra work is using the evalin function? Are you calling a lot of functions in the callbacks?
  5 件のコメント
Rey
Rey 2013 年 5 月 13 日
編集済み: Rey 2013 年 5 月 14 日
If you have information about since when the workspace_object.getVariable() method is supported, please let me know. I can't seem to find it in the documentation of releases prior to R2012a...
And a final question: Why is it not permitted to define buses in model workspace? Interestingly, Simulink allows evalin'ing scripts to do bus definitions in model workspace, but then it throws an error during compilation. And the error sounds weird: "Bus objects should only be created in base workspace." Not like " can only be created"...
Ryan G
Ryan G 2013 年 5 月 14 日
Not sure about getvariable. But someone already asked about the bus object problem.

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

カテゴリ

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