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!