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.

 采纳的回答

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++.

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Simulink Coder 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by