How to make a Simulink model constant?

坚强是说给别人听的谎言 提交于 2021-01-29 18:37:00

问题


I have a model in Simulink (2018a) which has more models inside. So I have:

parent.slx --> child.slx

I want child.slx to execute only once in the whole simulation, so basically its output will be constant at all times.


回答1:


You should be using the Model Block to call the child model. Put this block into an Enabled Subsystem Block in the parent model and create the enable signal in the following way:

You also need to make sure that the outport blocks within the subsystem are set to hold their value when disabled.




回答2:


Try putting the entire contents of child.slx within a triggered subsystem in parent.slx.
If it absolutely must be a separate file then try calling it from a Matlab User-Defined block; you may need to use eml.extrinsic sim ... I doubt that'd work though.



来源:https://stackoverflow.com/questions/51869755/how-to-make-a-simulink-model-constant

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!