开发者

Is it possible to call specific functions before a Simulink simulation begins?

开发者 https://www.devze.com 2023-03-21 16:34 出处:网络
More specifically, I would like to automatically clear the workspace and all functions before a Simulink simulation starts. Is this possible? Are there hooks where I can define functions to be called

More specifically, I would like to automatically clear the workspace and all functions before a Simulink simulation starts. Is this possible? Are there hooks where I can define functions to be called before and, say, after开发者_运维问答 each simulation?


You can do this using model callbacks.

You can set callbacks programmatically as described on the linked page, or just right-click on an empty spot in your model file, select Model Properties, then the Callbacks tab and enter the name of the function to be called after selecting the appropriate callback in the left pane.

In your case, the StartFcn callback seems appropriate.

0

精彩评论

暂无评论...
验证码 换一张
取 消