You can package deployable archives at the MATLAB®prompt or your system prompt using either of these commands.
deploytool
(MATLAB Compiler)invokes the Application Compiler app to execute a saved compiler project.
mcc
(MATLAB Compiler)invokes theMATLAB Compiler™to create a deployable application at the command prompt.
deploytool
Thedeploytool
command has two flags that invoke one of the compiler apps to package an already existing project without opening a window.
构建
— Invoke the correct compiler app to build the project but not generate an installer.project_name
-package
— Invoke the correct compiler app to build the project and generate an installer.project_name
For example,deploytool -package magicsquare
generates the binary files defined by themagicsquare
project and packages them into an installer that you can distribute to others.
mcc
Themcc
command invokes theMATLAB Compilerand provides fine-level control over the packaging of the deployable archive. It, however, cannot package the results in an installer.
To invoke the compiler to generate a deployable archive, use the-W CTF:
flag withcomponent_name
mcc
. The-W CTF:
flag creates a deployable archive calledcomponent_name
.component_name
.ctf
For packaging deployable archives, you can also use the following options.
Option | Description |
---|---|
-a |
Add any files on the path to the generated binary. |
-d |
Specify the folder into which the results of packaging are written. |
class{ |
Specify that an additional class is generated that includes methods for the listed MATLAB files. |
You perform the same functions using the compiler apps, acompiler.build
function, or themcc
command-line interface. The interactive menus and dialog boxes used in the compiler apps buildmcc
commands that are customized to your specification. As such, your MATLAB code is processed the same way as if you were packaging it usingmcc
.
If you know the commands for the type of application you want to deploy and do not require an installer, it is faster to execute eithercompiler.build
ormcc
than go through the compiler app workflow.
Compiler app advantages include:
You can perform related deployment tasks with a single intuitive interface.
You can maintain related information in a convenient project file.
Your project state persists between sessions.
You can load previously stored compiler projects from a prepopulated menu.
You can package applications for distribution.