- Add an extra input to the S-function and write a conditional statement to reset the states when the extra input value changes.
- Place the S-function inside of an enabled / triggered subsystem and set the "Output when disabled" to "reset" - this will call mdlInitialize every time the subsystem is disabled.
Reset Initial Conditions of level 1 S-function states
1 次查看(过去 30 天)
显示 更早的评论
Hello.
Is it possible to reset the initial conditions of the states of a continuous time level-1 s-fun? Usually the states I.C. are set by mdlInitializeSizes() function call at the beginning of the simulation. But what if in the middle of the sim I want to reset the IC?
Thanks.
0 个评论
回答(1 个)
Andrew Schenk
2015-6-17
There are two ways to do this. You can either:
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Block and Blockset Authoring 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!