C++ MATLAB Data API Shared Library Integration
Create and integrate packaged MATLAB® functions into C++ applications using the MATLAB Data API
Shared libraries that use the MATLAB Data API have a generic interface that uses modern C++
semantics. The interface supports C++11 functionality and has several
advantages over the mwArray
API, including
type-safety and multithread-safety. The interface provides functions
that ensure correct initialization and termination of applications. It
can be run either in-process or out-of-process and can call functions
asynchronously. For details, see MATLAB Data API for C++.
Functions
compiler.build.cppSharedLibrary | Create C++ shared library |
compiler.build.CppSharedLibraryOptions | Options for building C++ shared libraries |
mbuild | Compile and link source files against MATLAB generated shared libraries |
mcc | Compile MATLAB functions for deployment |
C/C++ API
matlab::cpplib::initMATLABApplication | Start the MATLAB Runtime and initialize its application state |
matlab::cpplib::runMain | Execute a function with its input arguments within the main function |
matlab::cpplib::convertUTF8StringToUTF16String | Convert UTF-8 string to UTF-16 string |
matlab::cpplib::convertUTF16StringToUTF8String | Convert UTF-16 string to UTF-8 string |
matlab::cpplib::initMATLABLibrary | Initialize a library of MATLAB functions packaged in a deployable archive file |
matlab::cpplib::initMATLABLibraryAsync | Initialize a library of MATLAB function asynchronously |
matlab::cpplib::MATLABLibrary::feval | Execute a MATLAB function from a deployable archive |
matlab::cpplib::MATLABLibrary::fevalAsync | Execute a MATLAB function from a deployable archive asynchronously |
matlab::cpplib::MATLABLibrary::waitForFiguresToClose | Wait for all figures to close |
Topics
Create and Implement a C++ MATLAB Data Array API Shared Library
- Generate a C++ MATLAB Data API Shared Library and Build a C++ Application
Create a C++ MATLAB Data API shared library from MATLAB code and integrate it with sample C++ driver code. - Create C/C++ Shared Libraries from Command Line
Use the command-line compiler to create C/C++ shared libraries.
Integrate a C++ Shared Library with C++ Application
- Integrate C++ Shared Libraries with MATLAB Data API
Write C++ code to reference shared libraries that use the MATLAB Data API. - Call MATLAB Compiler SDK API Functions from C/C++
Use MATLAB Compiler SDK™ shared library functions in C and C++ code. - Configure the mbuild Options File
How to configure thembuild
options file.
macOS
- Write Applications for macOS
Write deployable C++ applications specifically for macOS.
Strongly Typed Interface
- C++ MATLAB Data API Shared Library Support for Strongly Typed MATLAB Code
Learn how a C++ MATLAB Data API shared library supports using strongly typed MATLAB code. - Create C++ MATLAB Data API Shared Library Header from Strongly Typed MATLAB Function
Create a C++ MATLAB Data API shared library from a strongly typed MATLAB function and integrate it with sample C++ application code. - Create C++ MATLAB Data API Shared Library Header from Strongly Typed MATLAB Classes Contained in Package
Create a C++ MATLAB Data API shared library from strongly typed MATLAB class contained in a package and integrate it with sample C++ application code. - Data Type Mappings Between C++ and Strongly Typed MATLAB Code
Refer to data type mappings between C++ and MATLAB when using strongly typed MATLAB code.
Maintenance
- Memory Management and Cleanup
See recommendations on memory management. - Understand the mclmcrrt Proxy Layer
All application and software components generated by MATLAB Compiler™ and MATLAB Compiler SDK need to link against only one MATLAB library,mclmcrrt
. - Troubleshoot mbuild
Issues involving thembuild
utility and creating standalone applications.