Using For Each subsystem block for time slicing algorithm execution repetitions

2 次查看(过去 30 天)
I am using a For Each subsystem to repeat algorithm execution on four set of sensor readings in a single time step. The algorithm has some unit delay blocks. I use my model to generate C code. The generated code has four sets of storage variables corresponding to the unit delay blocks. I now want to spread out those four repeatitions in four consequtive time steps. Is it possible to continue using the for each subsystem block and achieve this ?
If not, what is the best way to do this ?

采纳的回答

Akash
Akash 2023-12-18
Hi Rishab,
I understand that you are looking to modify the behavior of your "For Each subsystem" in Simulink, so that instead of processing all four sets of sensor readings in a single time step, you want to spread the execution over four consecutive time steps while generating C code.
To achieve this, you can use "Conditionally Executed Subsystems". This approach allows you to control the execution of a subsystem based on an external signal. By utilizing a "control block" within your model, such as an "If" or "Switch" block, you can create logic that determines which set of sensor readings to process in each time step.
For more information on how to implement and configure Conditionally Executed Subsystems, you can refer to the below mentioned link:-
I hope it helps,
Thanks and Regards,
Akash.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Schedule Model Components 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by