Speed up simulation

2 次查看(过去 30 天)
Alexandru
Alexandru 2012-6-26
Hello,
I've read some of the questions posted on mathworks regarding this subject, but still I want to speed up the simulation for example by 10 times or 100 times.
The reason to do this is because I'm using a signal builder with lots of values used for testing a model and writing the outputs in an excel and to do this for all the values would take about 7h...
Thanks in advance, Alex

采纳的回答

Kaustubha Govind
Kaustubha Govind 2012-6-26
There are several techniques for improving your Simulink model's performance. Please see these articles:
Also, you mentioned writing outputs to an Excel file - do you do this at the end of simulation or at each time step? I'm assuming you use the XLSWRITE command?
  3 个评论
K E
K E 2012-6-26
You may also find this blog entry helpful for making sure you are not wasting time with the wrong step size, http://blogs.mathworks.com/seth/2012/06/04/the-most-useful-command-for-debugging-variable-step-solver-performance/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+SethOnSimulink+%28Seth+on+Simulink%29
Kaustubha Govind
Kaustubha Govind 2012-6-27
Nice tip KE!
@Alexandru: XLSWRITE opens and closes the Excel file at each time step, which I suspect may be slowing down your simulation. You could try using the Simulink Profiler to see where the slowdown is coming from before investing in improving the Excel writing part. If that S-function turns out to be the culprit, what you need is to only open once, write all your data and close it. You can either do this in your S-function by controlling the Excel COM connection (relevant function is: http://www.mathworks.com/help/techdoc/ref/actxserver.html) so that you open the file in setup() and close in terminate(). Or if you prefer to stick with XLSWRITE, just do it at the end of simulation.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Sources 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by