How to convert/run C++ (cpp and hpp files) from a GitHub folder on MATLAB?

7 次查看(过去 30 天)
Hello,
I was hoping someone would be able to provide me with a clear answer on how to run C++ in MATLAB.
I have run into a folder on GitHub that has peaked my interest, https://github.com/prometey1982/VolvoTools. I do not have access to a program that can run C++, and given I am a University student I do have access to MATLAB.
Is there a possible way to run these files through MATLAB and eventually export it as a .exe file?
I have downloaded the C++ add-on and watched the MATLAB YouTube video, but I am lost as what to do with static libraries and so forth.
I appreciate any and all help!

回答(1 个)

Amanjeet Pani
Amanjeet Pani 2022-7-13
From within your MATLAB code, you can directly call external C/C++ code, also called custom code or legacy code. To call C/C++ functions, use coder.ceval. The code generator integrates your C/C++ code into the C/C++ code generated from MATLAB. Integrate code when there are external libraries, optimized code, or object files developed in C/C++ that you want to use with your generated code. this seems to be the way out for your problem
Additionally you can go through this link to know more.

类别

Help CenterFile Exchange 中查找有关 Call C++ from MATLAB 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by