Deploy to C++ Applications Using MATLAB Data API (C++11)
In this approach, you use functionality in MATLAB
Compiler SDK™ to generate a code archive (
containing MATLAB functions, along with a header (
file) that establishes a mapping between MATLAB and C++ data types. Integrate these within your C++
Use MATLAB Compiler SDK API for C++ as an interface between the C++ application and the code archive containing the deployed MATLAB functions. Use the MATLAB Data API to handle data exchange between the C++ application and deployed MATLAB functions. For details on data exchange, see MATLAB Data API for C++.
To ensure that this is the right approach for you, see Choosing C++ Deployment Option.
MATLAB Runtime must be installed and set up on the machine running the C++ application. For details, see Install and Configure MATLAB Runtime.
|Start the MATLAB Runtime and initialize its application state
|Execute a function with its input arguments within the main function
|Convert UTF-8 string to UTF-16 string
|Convert UTF-16 string to UTF-8 string
|Initialize a library of MATLAB functions packaged in a deployable archive file
|Initialize a library of MATLAB function asynchronously
|Execute a MATLAB function from a deployable archive
|Execute a MATLAB function from a deployable archive asynchronously
|Wait for all figures to close
- MATLAB Compiler SDK C++ Target Requirements
Review the software requirements for using MATLAB Compiler SDK to deploy MATLAB functions to C++ applications.
- Setting Up C++ Development Environment
Set up development environment to develop C++ applications that integrate deployed MATLAB functions.
- Install and Configure MATLAB Runtime
Install, configure, and uninstall MATLAB Runtime.
- Choosing C++ Deployment Option
Explore C++ deployment options that MATLAB Compiler SDK offers and select the right one for your specific C++ integration needs.
- Summary of MATLAB Compiler SDK C++ APIs
Explore the various MATLAB Compiler SDK C++ APIs.
Create and Integrate
- Deploy MATLAB Function to C++ Application Using MATLAB Data API
Learn how to deploy a MATLAB function to C++ application using the MATLAB Data API.
- Deploy MATLAB Classes to C++ Application Using MATLAB Data API
Learn how to deploy MATLAB classes contained in a package to a C++ application using the MATLAB Data API.
- Code Archive (.ctf file) Placement
Explore various options for positioning the code archive (
.ctffile) in an accessible location prior to running the executable.
Data Type Mapping and Sample Generation
- 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.
- Mapping MATLAB Classes and Functions to C++
Learn how MATLAB classes and function map to a C++ header file when deployed using the MATLAB Data API.
- Create Sample Code to Call Exported Function
Generate sample code in C++, .NET, Java®, or Python® by including sample files during packaging.
More Code Samples
- Call MATLAB Compiler SDK API Functions from C/C++
Use MATLAB Compiler SDK shared library functions in C and C++ code.
- 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++ 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.
- 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.
- 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,
- Troubleshoot mbuild
Issues involving the
mbuildutility and creating standalone applications.