How to run embedded Matlab function in Simulink periodically
2 次查看(过去 30 天)
显示 更早的评论
I implemented a function inside Embedded Matlab function block in Simulink. I do not want the block to run in each consecutive simulation time step, but I want to run it periodically, let's say in each 1s. How can I do that?
0 个评论
采纳的回答
M
2018-2-7
You can access the simulation time in your m function using :
get_param('YourModel','SimulationTime')
or you can use the clock block to execute your action every second.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Sources 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!