How to control time in a while loop subsystem

조회 수: 3 (최근 30일)
Ben Rancici
Ben Rancici 2018년 1월 19일
편집: Ben Rancici 2018년 1월 19일
I did this simulink model and it worked (simplified representation below).
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".
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개)

카테고리

Help CenterFile Exchange에서 Subsystems에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by