Call MATLAB from C++ - MATLAB & Simulink (original) (raw)

Main Content

Run MATLAB® code from C++ programs, with object-oriented programming support and asynchronous execution

The MATLAB Engine API for C++ provides an interface between the C++ programming language and MATLAB. This API enables C++ programs to launch MATLAB, evaluate MATLAB functions with arguments, and exchange data between MATLAB and C++ programs. Supported operations include:

To get started, see Set Up C++ Development Environment.

The MATLAB Engine API for C++ uses the MATLAB Data API for C++, which provides a way for applications running outside of MATLAB to work with MATLAB data through a language-neutral interface. The engine API also provides a strongly typed interface that enforces a strict data type mapping between MATLAB and C++. You can use this strongly typed interface to call MATLAB functions and classes by their MATLAB names in C++ as if they were native C++ functions and classes. For an example, see Integrate Strongly Typed MATLAB Data in C++ Application.

Classes

Functions

Topics

Requirements

Integrate MATLAB Code in C++

Start and Connect to MATLAB

Call MATLAB Functions

Use MATLAB Data Types in C++