How can I initialize internal variable of s-function every simulation?
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
DongWook Shin
el 17 de Mzo. de 2020
Comentada: Ani Singh
el 24 de Mzo. de 2020
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 comentarios
Respuesta aceptada
Mark McBroom
el 22 de Mzo. de 2020
Add code to the mdlStart() or mdlInitialize() functions in the SFunctionto reset state variables.
2 comentarios
Ani Singh
el 24 de Mzo. de 2020
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.
Más respuestas (0)
Ver también
Categorías
Más información sobre Configure Block Features for MATLAB S-Functions en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!