Call C++ fromMATLAB
If you have a C or C++ shared library that exports functionality that can be called from another application, then you can use those classes and functions directly in MATLAB. To get started, you must firstbuild an interface to the libraryto use to call the functionality in MATLAB. Someone who creates this interface is called apublisher. You can package the interface and share it with a MATLABend user. For examples, see:
To call the library functionality in MATLAB, seeUse Prebuilt MATLAB Interface to C++ Library.
To call functions in a C shared library from MATLAB R2021b and earlier, use thecalllib
function. For information, seeCall C from MATLAB. This feature works best with C-only libraries.
创建MATLAB函数用C或c++编写的,eWrite C++ Functions Callable from MATLAB (MEX Files)orWrite C Functions Callable from MATLAB (MEX Files).
Catégories
- Build MATLAB Interface to C++ Library
To create a MATLAB interface to a C++ library, use the MATLABclibgen
package - Use Prebuilt MATLAB Interface to C++ Library
To call a function in a C++ library, use the MATLABclib
package