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?
0 个评论
回答(1 个)
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.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Subsystems 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!