- Start by placing an Entity Generator block in your Simulink model. This block will generate entities at a specified time interval.
- Connect the output of the Entity Generator block to a MATLAB Function block. This block will handle the logic for generating multiple entities at different time intervals.
- Inside the MATLAB Function block, use MATLAB code to implement the desired logic. You can use a counter variable to keep track of the number of entities generated and their time intervals.
- In the MATLAB code, specify the time intervals at which you want to generate entities. You can use a loop to generate entities at each specified time interval.
- Use the 'entity' function inside the MATLAB code to create new entities.
- Connect the output of the MATLAB Function block to the rest of your simulation model to simulate the behavior of the system with the incoming entities.
Trying to create multiple entities at periodic interval in Simulink
2 views (last 30 days)
Show older comments
I want to simulate people entering a system in Simulink, where a certain number of people begin at specified time intervals. However it seems the entity generator can only generate 1 entity at a time on a recurring basis, or generate multiple entities only at time zero, and then no more.
0 Comments
Answers (1)
Pratyush
on 23 Oct 2023
Hi Kurt,
I understand that you want to simulate people entering a system in Simulink with specified time intervals.
You can use a combination of Entity Generator blocks and MATLAB Function blocks. Here's an approach you can follow:
Hope this helps.
0 Comments
See Also
Categories
Find more on Communications Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!