问题
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