How to control time in a while loop subsystem
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I did this simulink model and it worked (simplified representation below).
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/169189/image.png)
Now, I want to put all these operations into a while loop subsystem (simplified representation in image 2) in order to change in each iteration some parameters in the subsystem "Operations_1".
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/169190/image.png)
But when I want to run it, I have this error :
'.../Derivative' has sample time 0. Only constant (inf) or inherited (-1) sample times are allowed in iterator subsystem '.../...'
I didn't find where to change this sample time, despite my researches on forums.
So I tried to remplace it with a Discrete Derivative (because of the fact the signals are triggered and not continuous in the while loop) but I got this error :
Iterator subsystem '...' cannot contain block '.../Discrete Derivative/TSamp' because this block requires a service that maintains the time that
has elapsed between two consecutive executions. Since the iterator subsystem can be executed multiple times at a given time step, the concept of
elapsed time is not well-defined between two such executions.
I don't know how to do time-related operations into a while loop subsystem. I got this error not only on this specific derivative block, I also have some transfer functions in the subsystems 1&2 and I got similar results.
0 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur Subsystems 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!