C++ withMATLAB
There are several ways to connect C/C++ and MATLAB:
Shared libraries—If you have a C or C++ shared library that exports functionality, you can build and package a MATLAB interface to that library and share it with a MATLAB user. For details, seeCall C++ from MATLAB.
Access MATLAB from C++—To write C++ programs that launch MATLAB, evaluate MATLAB functions with arguments, and exchange data between MATLAB and C++ programs, use the MATLAB Engine API for C++. For details, seeCall MATLAB from C++. To work with MATLAB data, seeMATLAB Data API for C++.
从MATLAB c++代码运行(墨西哥人文件)——创建垫LAB functions that provide the efficiency of C++ programs and that can access external functions and libraries from MATLAB, use the C++ MEX API. For details, seeWrite C++ Functions Callable from MATLAB (MEX Files).
Some existing code uses C interfaces that call theloadlibrary
function or include theC Matrix API, but those interfaces have limited C++ language support. If you need to maintain such code, seeCall C from MATLAB.
Categories
- Call C++ from MATLAB
Directly call C and C++ library functionality from MATLAB - Call C/C++ MEX Functions from MATLAB
A MEX file is a function, created in MATLAB, that calls a C/C++ program - Call MATLAB from C++
Run MATLAB code from C++ programs, with object-oriented programming support and asynchronous execution - MATLAB Data API for C++
Use the MATLAB Data API to read and write MATLAB data from C++ programs