How can i manipulate c code generated from MATLAB Coder?(DLL)
3 次查看(过去 30 天)
显示 更早的评论
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!
0 个评论
回答(1 个)
David Fink
2023-12-22
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:
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!