How to run embedded Matlab function in Simulink periodically

1 回表示 (過去 30 日間)
Baris Ciftci
Baris Ciftci 2018 年 2 月 7 日
回答済み: M 2018 年 2 月 7 日
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?

採用された回答

M
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 件)

カテゴリ

Help Center および File ExchangeEmbedded Coder についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by