Dynamically starting model instances in Simulink
댓글 수: 1
Simulink determines initial conditions at simulation startup, so you can’t simply update a 6DOF block’s initial state mid-run. One common workaround is to delay activating each instance until after the top-level model has computed its state. For example, you can encapsulate the 6DOF block in a Triggered or Enabled Subsystem. Then, once the desired initial conditions are calculated, you can update the block’s parameters (via workspace variables or callbacks) and enable the subsystem so that the 6DOF block initializes with those conditions. Alternatively, if you don’t require concurrent execution, you could run separate simulation instances (using the sim command in a MATLAB loop) where you pass in the computed initial conditions.
Follow me so you can message me anytime with future questions. If this helps, please accept the answer and upvote it as well.
답변 (1개)
0 개 추천
카테고리
도움말 센터 및 File Exchange에서 Subsystems에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!