Choose Deployment Option
MATLAB® Compiler™ provides several options for packaging MATLAB code into software components for standalone deployment or integration with other programming languages, depending on the desired build target. You can package code at the command line or using a compiler app associated with the build target.
The compiler apps allow you to package MATLAB code using a graphical interface.
The
compiler.build
andcompiler.package
functions allow you to package MATLAB code at the command line using a simplified interface.The
mcc
function allows you to package MATLAB code at the command line and offers additional, less common options to control the packaging process.
For more information on the steps required to package and deploy code, see Steps for Deployment with MATLAB Compiler.
Get Started with Compiler Apps
Package code using a graphical user interface with compiler apps. The apps provide a simplified interface to specify packaging options. The apps generate an installer that installs your application along with MATLAB Runtime.
The following compiler apps are available with MATLAB Compiler.
Standalone Application Compiler — Create standalone applications and standalone Windows® applications.
Excel Add-in Compiler — Create Excel® add-ins.
Web App Compiler — Create web apps for MATLAB Web App Server™.
With MATLAB Compiler SDK™, you can also use the following apps.
C Shared Library Compiler — Create C shared libraries.
C++ Shared Library Compiler — Create C++ shared libraries.
.NET Assembly Compiler — Create .NET assemblies.
COM Component Compiler — Create COM components.
Java Package Compiler — Create Java® packages.
Python Package Compiler — Create Python® packages.
Production Server Archive Compiler — Create archives for MATLAB Production Server™.
Compiler app advantages include:
Perform related deployment tasks with a single intuitive interface.
Maintain related information in a convenient project file.
Your project state persists between sessions.
Load previously stored compiler projects from a prepopulated menu.
Automatically generate an installer to package applications for distribution.
Export build settings as a MATLAB deployment script.
Compile Using compiler.build
Command Line Functions
Functions in the compiler.build
family provide a modern command
line interface for packaging MATLAB code. Each function is associated with a specific build target and allows
you to customize the packaging process using name-value arguments.
compiler.build
functions do not generate an application installer.
To create an installer for an application created using a
compiler.build
function, see compiler.package.installer
.
Several compiler.build
functions are available.
compiler.build.standaloneApplication
— Create standalone applications.compiler.build.standaloneWindowsApplication
— Create standalone Windows applications.compiler.build.webAppArchive
— Create web app archives.compiler.build.excelAddIn
— Create Excel add-ins.compiler.package.docker
— Create Docker® images.
With MATLAB Compiler SDK, you can also use the following functions.
compiler.build.cSharedLibrary
— Create C shared libraries.compiler.build.cppSharedLibrary
— Create C++ shared libraries.compiler.build.dotNETAssembly
— Create .NET assemblies.compiler.build.javaPackage
— Create Java packages.compiler.build.pythonPackage
— Create Python packages.compiler.build.productionServerArchive
— Create production server archives.compiler.build.excelClientForProductionServer
— Create Excel add-ins for MATLAB Production Server.compiler.build.comComponent
— Create COM components.compiler.package.microserviceDockerImage
— Create microservice Docker images.
compiler.build
advantages include:
If you do not require an installer, it is faster to execute
compiler.build
than use the compiler app workflow.Functions have a familiar command line interface similar to other MATLAB functions.
Perform batch deployment tasks using deployment scripts or using a
compiler.build.
object.<Target>
OptionsUse the
compiler.build.Results
output for post-processing tasks, such as creating an installer.Packaging options have descriptive names instead of flags.
Specify Additional Packaging Options Using mcc
mcc
is a MATLAB function that allows you to compile MATLAB code for deployment to any available build target.
mcc
has many option flags that let you control the output and
packaging method. For example, you can use the -R
option to specify run time options for MATLAB Runtime. Use mcc
if you require fine control of the packaging
process.
mcc
does not generate an application installer. To create an
installer for an application created using mcc
, see compiler.package.installer
.
mcc
advantages include:
Specify advanced compiler options not available with other packaging methods.
Run
mcc
in the MATLAB Command Window or at the system command prompt.The Spark™ application target is only available with
mcc
.
Limitations
compiler.build
Limitations
These functions offer most, but not all, of the packaging options available with
mcc
.Note
If you call a
compiler.build
function with theVerbose
option set totrue
, the output displays themcc
command used to compile the artifact. To specify additionalmcc
build options, you can append them to this command and recompile.You cannot create Spark applications using a
compiler.build
function. To create a Spark application, usemcc
.You cannot create Hadoop® jobs using a
compiler.build
function. To create a Hadoop application, usemcc
.
Compiler App Limitations
The compiler apps offer most, but not all, of the packaging options available with
mcc
.Before R2025a: For additional customization, you can specify
mcc
option flags using the Files required for your application to run section in any compiler app except Web App Compiler.You cannot create Excel add-ins for MATLAB Production Server using a compiler app. To create Excel add-ins for MATLAB Production Server, use the
compiler.build.excelClientForProductionServer
function.You cannot create Docker images or microservice images using a compiler app. To create a Docker image, use the
compiler.package.docker
orcompiler.package.microserviceDockerImage
function.You cannot create Spark applications using a compiler app. To create a Spark application, use the
mcc
function.You cannot create Spark applications using a compiler app. To create a Spark application, use the
mcc
function.Compiler projects may not be compatible across MATLAB releases. When you open deployment projects created in releases before R2025a, MATLAB automatically upgrades them to MATLAB projects. For more information, see Target-Specific Compiler Apps for MATLAB Code Deployment.
mcc
Limitations
You cannot create web apps using
mcc
. Create web apps using the Web App Compiler app or thecompiler.build.webAppArchive
function.You cannot create standalone Docker images using
mcc
. To create a standalone Docker image, use thecompiler.package.docker
function.You cannot create microservice Docker images using
mcc
. To create a microservice Docker image, use thecompiler.package.microserviceDockerImage
function.
See Also
compiler.build.Results
| mcc
| compiler.package.installer