MATLAB Function Versus MATLAB S-Function (processing speed)

Simulink
Why block MATLAB FUNCTION is slower than block MATLAB S-Function in may model?
The task is the same.

 Respuesta aceptada

Kaustubha Govind
Kaustubha Govind el 19 de Feb. de 2013
When you say "MATLAB Function" block, do you mean the Embedded MATLAB Function block (the block icon has the MathWorks logo on it), or the Interpreted MATLAB Function block? Also, it would help if you post your code. Some functions (like FFT) may be faster if run in interpreted mode in MATLAB than with the Embedded MATLAB Function block, which generates C-code from the MATLAB functions. Some MATLAB implementations are highly optimized, and hence perform better than the generated C code.

1 comentario

Ivan
Ivan el 20 de Feb. de 2013
My problem is a simple example in the picture.
Top S-function written in C + +. Lower Matlab function written in Matlab. Blocks of the same function, but the top is 4 times faster. Why? Maybe this is due to the creation of the wrapper in the case of the lower block? M-code consists of five lines, and 800 lines of the wrapper. wrapper slows down speed of model?

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Simulink Coder en Centro de ayuda y File Exchange.

Productos

Preguntada:

el 18 de Feb. de 2013

Community Treasure Hunt

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

Start Hunting!

Translated by