Borrar filtros
Borrar filtros

Using For Each subsystem block for time slicing algorithm execution repetitions

1 visualización (últimos 30 días)
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 ?

Respuesta aceptada

Akash
Akash el 18 de Dic. de 2023
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.

Más respuestas (0)

Categorías

Más información sobre Schedule Model Components en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by