Use Prebuilt MATLAB Interface to C++ Library - MATLAB & Simulink (original) (raw)

To call a function in a C++ library, use the MATLAB® clib namespace

If you have a published MATLAB interface to a C++ shared library, then you can use these classes and functions directly in MATLAB, passing data back and forth between MATLAB and C++.

Functions

clibArray Create MATLAB clib array for C++ library functions (Since R2020a)
clibConvertArray Convert MATLAB fundamental or struct array to MATLAB array of C++ objects (Since R2020a)
clibConfiguration Change execution mode of C++ library interface (Since R2023a)
CLibraryConfiguration C++ library interface environment information (Since R2023a)
clibIsNull Determine if C++ object is null
clibIsReadOnly Determine if C++ object is read-only
clibRelease Release C++ object from MATLAB
underlyingValue Underlying numeric value for C++ enumeration object created in MATLAB

Topics

Call C++ Functions

Represent C++ Arrays and Objects

Configure C++ Library Interface

Troubleshooting

Troubleshooting MATLAB Interface to C++ Library Issues

MATLAB searches for the library interface file on the MATLAB path.

Limitations to C/C++ Support

C/C++ library features not supported in MATLAB.

Handling Exceptions

Using C++ exceptions in MATLAB.