Main Content

What is Strongly Typed Interface for C++?

Use the strongly typed interface to generate C++ header files for MATLAB® functions and classes. When you build a C++ application with these header files, you can use MATLAB functions and classes as C++ functions and classes without writing C++ code. For more information, see Write MATLAB Code for Strongly Typed Interface.

To generate the C++ header files, call the matlab.engine.typedinterface.generateCPP function. The function reads the type and validation data from the MATLAB function and class definition and creates corresponding C++ definitions. For details, see Data Type Mappings Between C++ and Strongly Typed MATLAB Code.

When to Use a C++ Strongly Typed Interface

If you build C++ engine applications and work with object oriented data using the feval function, a strongly typed interface lets you call the MATLAB classes and functions by their MATLAB names in C++ as if they are native C++ classes or functions.

Limitations

Handle classes are not supported.

Supported MATLAB classes must be user-authored and can only inherit from other supported classes. Supported MATLAB functions also must be user-authored.

See Also

Related Examples

More About