필터 지우기
필터 지우기

How do i pause every iteration in a for iteration subsystem for a specified amount of time?

조회 수: 1 (최근 30일)
For the simulink external mode setting, i am planning to design a simulink model that is equivalent to:
for i = 1:16
for j = 1:16
......configure multiplexers......................
......read some data from sensors that have refresh rate of 0.02s...........
pause(0.02) %pause for 0.02milliseconds
end
end
I have noticed that for iteration subsystems have either a -1 or inf sample time setting. It would be great if the sample time can be configured for the inner for loop. I have also encountered compiling errors when a custom matlab pause function attached to a data source is written within the for iteration subsystems. Are there any solutions to replicating this logic in simulink?

답변 (1개)

Chidvi Modala
Chidvi Modala 2019년 8월 7일
you can refer to Access Block Data During Simulation which lets you work your MATLAB code into simulation process. In the provided documentation you can see the mechanism involves attaching a Post Outputs callback to specific block, so your function is called at every step that the block produces new outputs.

카테고리

Help CenterFile Exchange에서 Subsystems에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by