Retaining previously held values in simulink
10 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have a simulink model that is run using a code in a loop in consecutive time-steps. However, there's a problem, that the model resets itself before each new time-step (loop). I was wondering if there is an option for the model to NOT RESET itself before new iteration, in other words, I want all signals to keep (retain) their last held values from previous iteration. Thanks.
0 commentaires
Réponses (1)
Jonas
le 13 Fév 2020
Modifié(e) : Jonas
le 13 Fév 2020
It is not completely clear to me what your set-up looks like, but you may want to investigate 'Enabled Subsystems'. You can set each output to be 'held' or 'reset' when enabling.
2 commentaires
Jonas
le 14 Fév 2020
I assume that each iteration you do, is running the simulation model, stopping it, and starting it from stratch. What I would do is put the part that you want to iterate inside an Enabled Subsystem but the plant model not. Then you could enable and reset the iterative part that you DO want to reset with a certain clock or trigger. The plant model however just keeps running.
This means that instead of running, stopping and restarting your whole Simulink model, you run it once.
Hope this is somewhat clear and inspiring.
Voir également
Catégories
En savoir plus sur Linear Plant Specification dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!