How can I initialize internal variable of s-function every simulation?
5 次查看(过去 30 天)
显示 更早的评论
Hello :D
I'm having a problem with s-function.
I'd like to initialize all value of s-function, but I can't.
I think the last value of internal variable is not initialized when I execute simulation again.
So, before execute simulation, I'd like to initialize internal state of s-function.
I'm wating for your answers.
Thank you.
0 个评论
采纳的回答
Mark McBroom
2020-3-22
Add code to the mdlStart() or mdlInitialize() functions in the SFunctionto reset state variables.
2 个评论
Ani Singh
2020-3-24
Put your S-function inside an enabled subsystem with "Output when disabled" set to "reset" - this will call your mdlInitializeConditions method every time the subsystem is disabled.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Simulink Functions 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!