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