matlab.engine.typedinterface.generateCPP
Generate C++ code interface for MATLAB namespaces, classes, and functions
Since R2022a
Description
matlab.engine.typedinterface.generateCPP(
creates a C++ header file from one or more MATLAB® namespaces, classes, and functions. You must specify at least one
headerFile
,Name=Value
)Namespaces
, Classes
, or Functions
name-value argument. Use the header file to build a C++ engine application.
The generated header file:
Maps strongly typed MATLAB data types to C++ data types.
Contains C++ namespaces that correspond to MATLAB namespace folders of the same name.
Contains C++ classes that correspond to MATLAB classes of the same name.
Contains public C++ methods that correspond to the public methods of MATLAB classes. The method names are unchanged and can be used as is in the C++ application code. These aligned names eliminate the need for intermediate layer top-level functions that call the class methods through an
feval
function execution.Contains C++
get
andset
methods for public properties of MATLAB classes. The property names of MATLAB classes are prepended withget
orset
. For example, if the property name in a MATLAB class isUpperLeft
, the corresponding C++ method names aregetUpperLeft
andsetUpperLeft
.
For more information, see Write MATLAB Code for Strongly Typed C++ Interface.