Package MATLAB Functions
MATLAB
Compiler SDK™ enables you to build deployable archives in a target language
that include MATLAB functions. You can build these artifacts at the MATLAB command line using any of the
compiler.build
family of functions, or specify
additional compile time options using mcc
. You can also
package the artifact into an installer that installs the necessary files and
MATLAB Runtime libraries onto the target machine. MATLAB
Compiler SDK includes two deploytool
apps and the
command line function compiler.package.installer
for
this purpose.
To incorporate a deployable archive into an application in the target language, you can use MATLAB Compiler SDK generated sample files or create your own application. Distribute the application to end users along with MATLAB Runtime, which contains libraries necessary to run the code.
Apps
COM Component Compiler | Package MATLAB programs for deployment as COM components (Since R2025a) |
C Shared Library Compiler | Package MATLAB programs for deployment as C shared libraries (Since R2025a) |
C++ Shared Library Compiler | Package MATLAB programs for deployment as C++ shared libraries (Since R2025a) |
.NET Assembly Compiler | Package MATLAB programs for deployment as .NET assemblies (Since R2025a) |
Java Package Compiler | Package MATLAB programs for deployment as Java packages (Since R2025a) |
Python Package Compiler | Package MATLAB programs for deployment as Python packages (Since R2025a) |
Production Server Archive Compiler | Package MATLAB programs for deployment as MATLAB Production Server archives (Since R2025a) |
Functions
Topics
Packaging
- Target-Specific Compiler Apps for MATLAB Code Deployment
Learn how to use target-specific compiler apps for MATLAB code deployment. - Write Deployable MATLAB Code
Write flexible MATLAB code that can be packaged and deployed. - Include and Access Files in Packaged Applications
Include and access additional files in packaged applications. - Protect Code and Data in Deployable Archive
Protect deployed code, data, and configuration using one or more security packaging options. - Handle Sensitive Information in Deployed Applications
Use secrets to remove sensitive information from deployed code. (Since R2024a) - State-Dependent Functions
Dealing with MATLAB functions that carry state. - Manage Support Packages
Including support packages when packaging MATLAB applications.
MATLAB Test
- Generate Deployed Code Artifacts and Test for Equivalence
Generate deployed code artifacts with MATLAB Compiler SDK and verify that the execution of the generated artifacts and MATLAB code are equivalent.
Deployment and Integration
- Create Sample Code to Call Exported Function
Generate sample code in C++, .NET, Java®, or Python® by including sample files during packaging. - Distribute MATLAB Compiler SDK Files to Application Developers
Distribute files generated by MATLAB Compiler SDK and integrate them in an application. - Integrate Artifact with Target Language Application
Create an application that uses your packaged MATLAB functionality. - Deploy Applications and MATLAB Runtime on Network Drives
Run MATLAB Compiler™ generated applications from a network drive. - Files Generated After Packaging MATLAB Functions
Refer to the list of files generated after packaging MATLAB functions. - Manage Application State in Deployed Archives
Test application before deployment and cache data in application archives deployed to MATLAB Production Server™.
Limitations and Restrictions
- Limitations
MATLAB Compiler has limitations regarding what can be compiled. - Ensure Multiplatform Portability for Compiled Applications
Ensure platform independence in your compiled MATLAB code. - Functions Not Supported for Compilation by MATLAB Compiler and MATLAB Compiler SDK
Refer to functions not able to be compiled with MATLAB Compiler or MATLAB Compiler SDK. - Testing Failures
List of possible failures during testing. - Troubleshoot mbuild
Issues involving thembuild
utility and creating standalone applications. - Supported MATLAB Data Types for Client and Server Marshaling
List of supported and unsupported MATLAB data types.