How can i manipulate c code generated from MATLAB Coder?(DLL)

Hello everyone!
I have a matlab project, which consists of a main function and many outsourced subfunctions.I would like to execute this project in c for better performance. I have used the following work instruction:
(I used the Matlab coder, to write c functions using DLL)
The matlab coder then outputs the corresponding functions translated into c. The procedure works, but the most computationally intensive part of the program, a matrix inversion, still takes a lot of time. that's why I want to rewrite the files generated by the coder so that they do the matrix inversion through the "eigen-library".
For whatever reason, the change i make to the inv.c file has no effect on the execution of the created project in visual studio. Even if I add an error that should make the inv.c function not work at all, the matrix inversion is executed normally, as if I had not made any changes at all.
Now my question is how I can manipulate this generated c code so that the change takes effect in the created project.
And if you know another way to execute a matrix inversion more efficient than MATLAB, please let me know too!
Thank you and happy holidays!

답변 (1개)

David Fink
David Fink 2023년 12월 22일

2 개 추천

MATLAB Coder can be configured to use BLAS and LAPACK calls in generated code, which can improve the performance of linear algebra operations like matrix inverse:
However, note that solving systems of equations Ax = b via \ (mldivide) can be more accurate and efficient than using inv:

카테고리

도움말 센터File Exchange에서 MATLAB Coder에 대해 자세히 알아보기

제품

릴리스

R2023b

질문:

Jan
2023년 12월 21일

답변:

2023년 12월 22일

Community Treasure Hunt

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

Start Hunting!

Translated by