MATLAB Compiler SDK™ enables you to create C/C++ shared libraries from MATLAB functions. You have three options to create shared libraries:
Create C shared libraries that use the
Create C++ shared libraries that use the
Create C++ shared libraries that use the MATLAB Data API.
Shared libraries that use the
mwArray API have an interface
that uses C-style functions to initialize the MATLAB Runtime, load the compiled MATLAB functions into the MATLAB Runtime, and manage data that is passed between the C++ code and the
MATLAB Runtime. The interface supports only C++03 functionality. For an example, see
Integrate a C++ mwArray API Shared Library into an Application.
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 more information, see Workflow to Integrate with a C++ Shared Library that Uses the MATLAB Data API. For an
example, see Integrate a C++ MATLAB Data API Shared Library into an Application.
The MATLAB Data API was introduced in R2017b.
|Compile and link source files against MATLAB generated shared libraries|
|Initializes the MATLAB Runtime proxy library|
|Set up application state shared by all MATLAB Runtime instances created in current process|
|Close MATLAB Runtime-internal application state|
|Initialize MATLAB Runtime instance associated with library|
|Free all resources allocated by MATLAB Runtime instance associated with library|
|Mechanism for creating identical wrapper code across all platforms|
|Determine if MATLAB Runtime has been properly initialized|
|Enable deployed applications to process graphics events, enabling figure windows to remain displayed|
|Last error message from unsuccessful function call|
|Retrieve name of log file used by MATLAB Runtime|
|Determine if MATLAB Runtime was launched with instance of Java Virtual Machine (JVM)|
|Determine if -nodisplay mode is enabled|
|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|
Example on how to call a C shared library built with MATLAB Compiler SDK from a C application.
Example on how to call a C++
mwArray API shared library built
Compiler SDK from a C++ application.
Example on how to call a C++ MATLAB Data API shared library built with MATLAB Compiler SDK from a C++ application.
Workflow to integrate with a C++ shared library that uses the MATLAB Data API.
Guidelines on writing C++ driver code using the generic interface for integration with C++ shared libraries that use the MATLAB Data API.
Workflow to integrate with a shared library that uses the
Process to create and distribute C shared libraries.
Process to create and distribute C++ shared libraries.
Process to call MATLAB Compiler SDK API functions from C/C++.
How to use multiple generated shared libraries in a single C/C++ application.
How to configure the
mbuild options file.
How to integrate a COM object into a Visual C++® program
Guidelines for writing deployable C++ applications specifically for macOS
Path settings for machines where you want to develop and test applications that contain compiled MATLAB code
Recommendations on memory management
Set MATLAB Runtime options, such as
All application and software components generated by MATLAB
Compiler™ and MATLAB
Compiler SDK need
to link against only one MATLAB library,
How to override the default archive embedding behavior and how to use MATLAB Runtime component cache