Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

Simulink - Speeding up

1 visualizzazione (ultimi 30 giorni)
JOKY JOKE
JOKY JOKE il 12 Ott 2011
Chiuso: MATLAB Answer Bot il 20 Ago 2021
Hi,
I have read many articles about speeding up SIMULINK so far. I have also seen the Webinars. So far, I still dont know, if it is better to use Simulink blocks, Embedded Matlab or Stateflow. It is clear, that it also depends on the function, that one needs to implement, but is there a general rule, what kind of programming is the fastet? In many cases, I can implement the task in either way...
Thank you.

Risposte (1)

Kaustubha Govind
Kaustubha Govind il 12 Ott 2011
I hesitate to provide a simple answer to this, but here is goes anyway.
Almost all Simulink library blocks are either implemented as built-in blocks or S-functions in either C/C++ - you might say that these run as fast as possible. However, both Embedded MATLAB blocks and Stateflow also generate a C-based S-function from user-defined code right before simulation starts. So there is some overhead at the start of simulation, but in the simplest sense, they all should have comparable performance during simulation.
Of course there are other tradeoffs - Stateflow and Simulink are good at solving different kinds of problems. Embedded MATLAB is great if you are more comfortable with programming in MATLAB and can limit yourself to the set of supported functions (note that calling unsupported functions using eml.extrinsic will result in these calls being dispatched to the MATLAB interpreter, and you lose performance).

Questa domanda è chiusa.

Community Treasure Hunt

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

Start Hunting!

Translated by