Main Content

Call C++ fromMATLAB

Directly call C and C++ library functionality from MATLAB®

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 thecalllibfunction. 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

Informations connexes