Using For Each subsystem block for time slicing algorithm execution repetitions
1 回表示 (過去 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 ?
0 件のコメント
採用された回答
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 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Schedule Model Components についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!