How to Execute Maltab Function Block Every X Seconds in Simulink?

44 ビュー (過去 30 日間)
Andrew Poissant
Andrew Poissant 2018 年 11 月 14 日
コメント済み: Charles David 2023 年 10 月 7 日
I have a Matlab Function Block that slows down my SImulink simulation. Is there a way to execute the Matlab Function Block every X seconds so my simulation will run faster? It is unnecessary to run the Matlab Function Block every time iteration.

採用された回答

Titus Edelhofer
Titus Edelhofer 2018 年 11 月 14 日
Hi Andrew,
you can achieve this by assigning a sample time: right click on the block, choose "Block Parameters (Subsystem)", and set the Sample Time to 1.
Titus
  2 件のコメント
Charles David
Charles David 2023 年 10 月 7 日
Thanks a lot... I searched the Internet for a long time to find this solution.
Charles David
Charles David 2023 年 10 月 7 日
maybe this works for all other block in simulink, I was working with 'Matlab function block' • I noticed that when my sample time for the 'Matlab function block' was made more than my simulation time... I got exactly one output from the 'Matlab function block'
For some reason, this was what I wanted all along.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by