How to Make a Simulink Scheduler for a Matlab Block Function to run each 40 ms of simulation?
5 views (last 30 days)
Gianluca Mammone on 10 Aug 2022
Hello, I am trying to make a controller for a system that must run every 40-50 ms. I am having difficulties with Stateflow because if I try to adapt the example given by Mathworks the matlab blocks runs just once.
In the picture you see the controller that I adapted from the example
this is "Edge to Function" block
and this is the simple subsystem called by Call() event
inside the matlab block there is only
j = 0;
for i = 1:10
j = j+1;
and here the plot of the output j, as you can see the block is triggered just once
Can you please help me to understand how to call the matlab block every 40 seconds or address me to a good stateflow scheduler tutorial? I haven't been lucky