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!