Why does the interpreted MATLAB function slow down simulink so much and how can I speed it up?

5 ビュー (過去 30 日間)
Evan John
Evan John 2018 年 2 月 6 日
コメント済み: Jan 2018 年 2 月 6 日
I have built a model in simulink that takes about 30 seconds to simulate ~600 seconds, which is good considering the number of ODE's in the model. However, I am now at a point where I need to include an additional piece of code that cannot be constructed in simulink. For this, I used the interpreted MATLAB function block. When I run the piece of code independent of simulink (as in, I just call it from the command window as you normally would), it takes <0.5 seconds to run. However, when I throw it into the interpreted MATLAB function block, it takes 15 minutes for it to run just 1 iteration of the MATLAB function. This is obviously too long considering how much time I am trying to simulate. What is the reason for this dramatic increase and how can I make it faster?
Thank you!
  1 件のコメント
Jan
Jan 2018 年 2 月 6 日
Without seeing any line of the code, it is impossible to guess the reason correctly. Post your code here and some typical example data.

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

回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by