# In simulink model, how will we give a simulation time interval in between, while the simulation is running from 0 to 5 sec. Is there any code syntax for this ?

10 views (last 30 days)
Siddharth Kamila on 8 Jun 2022
Answered: SAI SRUJAN on 25 Oct 2023
In simulink model, how will we give a simulation time interval in between, while the simulation is running from 0 to 5 sec. Is there any code syntax for this ?
For e.g. :- Let's say, when we start the simulation from 0 sec to 5 sec, the data is processed (input data is given to a system and output data is generated) from 0 sec to 0.05 sec time, then there is an interval from 0.05 sec to 0.06 sec (no processing of data will take place in this interval, no input will be sent to the system and thus no output is generated), and again the data processing goes on (input data is given to a system and output data is generated) from 0.06 sec to 0.11 sec, then again there is interval at 0.11 sec to 0.12 sec (no processing of data will take place in this interval, no input will be sent to the system and thus no output is generated), again from 0.12 sec to 0.17 sec the data processing goes on (input data is given to a system and output data is generated), from 0.17 sec to 0.18 sec, there is an interval (no processing of data will take place in this interval, no input will be sent to the system and thus no output is generated), and like that, this process goes on till 5 sec simulation time.
So, is there any code syntax for providing this time interval ? Atleast give me some suggestion. I am not asking for an exact answer.
Fangjun Jiang on 8 Jun 2022
Is that in the model's "solver" setting?
Siddharth Kamila on 8 Jun 2022
no sir, it is not in model's solver setting.

SAI SRUJAN on 25 Oct 2023
Hi Siddarth Kamila,
I understand that you are trying to figure out about the approach to process data at a specific interval of time.
In Simulink, you can achieve the desired time interval behavior using the "Triggered Subsystem" block. This block allows you to specify when the subsystem should be executed based on a trigger signal.
1. Create a subsystem that represents the data processing you want to perform during each interval.
2. Place a Triggered Subsystem block in your Simulink model, and connect it to the rest of your model.
3. Configure the Triggered Subsystem block to trigger based on a signal that defines the time intervals.
4. Inside the Triggered Subsystem block, place your data processing subsystem.
5. Configure the Triggered Subsystem block to execute the subsystem only when the trigger signal is active.
You can refer to the attached documentation to get a better understanding of Triggered Subsystems.

### Categories

Find more on Schedule Model Components in Help Center and File Exchange

R2018a

### Community Treasure Hunt

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

Start Hunting!