Does the code generated with Real-Time Workshop execute faster than the same application built in MATLAB?

I have Simulink model which computes the Eigen Vectors for a matrix and I generated code for the model using Real-Time Workshop. I also wrote an M-script which computes the eigen vectors for the matrix used in the Simulink model. I observe that the M-script is faster than the Real-Time Workshop generated executable.

 Respuesta aceptada

The reason for the performance difference is that the MATLAB routine EIG uses a highly optimized FORTRAN based library to do the computation which has an advantage over the C based function generated using the MATLAB Embedded Function block. In general, all matrix based computations have a slight advantage in MATLAB when compared to their counterparts developed in C due to the advantages of vectorized matrix reading in FORTRAN and MATLAB compared to the loop based matrix operations in C/C++.

Más respuestas (0)

Categorías

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

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by