How to control time in a while loop subsystem
5 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Schedule Model Components 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!