How to make Simulink run the entire model just once?

13 ビュー (過去 30 日間)
espey
espey 2019 年 5 月 23 日
回答済み: Fangjun Jiang 2019 年 5 月 23 日
I have created a Simulink Model with some custom MATLAB function Blocks and some constant Blocks. I run the Simulink Model from a .m file using the sim() function. I see that when I call the Model this way just once, the entire model is being run again and again for 50 times(putting a breakpoint inside each of the MATLAB function blocks shows that they are being called 50 times with the same input values). Reducing the simulation time from Configuration Parameters does not help.
I am using MATLAB 2017b.
Please help.

回答 (1 件)

Fangjun Jiang
Fangjun Jiang 2019 年 5 月 23 日
Each MATLAB function block will be executed once for every simulation step. Inside the MATLAB function block, there could be loops. No way to tell with your info above. The .m file could call sim() in a loop.
Just simulate the model once, manually, to see what happens.

カテゴリ

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

製品


リリース

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by