You can compile standalone applications at the MATLAB® prompt or your system prompt using either of these commands.
deploytool
invokes
the Application Compiler app to execute a saved compiler project.
mcc
invokes
the MATLAB
Compiler™ to compile code at the prompt.
The deploytool
command has two flags to
invoke one of the compiler apps without opening a window.
-build
—
Invoke the correct compiler app to build the project and 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 the magicsquare
project
and packages them into an installer that you can distribute to others.
The mcc
command invokes
the MATLAB compiler to compile code at the prompt and provides
fine-level control compiling an application. It does not package the
results in an installer.
To invoke the compiler to generate an application, use mcc
with
either the -m
or the-e
flag.
Both flags compile a MATLAB function and generate a standalone
executable. The -m
flag creates a standard executable
that runs at a system command line. On Windows®, the-e
flag
generates an executable that does not open a command prompt when double-clicked
from the Windows file explorer.
Use the following mcc
options
to compile standalone applications.
Option | Description |
---|---|
-W main -T link:exe | Generate a standard executable equivalent to using -m . |
-W WinMain -T link:exe | Generate an executable that does not open a command prompt
when double-clicked from the Windows file explorer equivalent
to using -e . |
-a | Add any files on the path to the generated binaries. |
-d | Specify the folder for the compiled applications. |
-o | Specify the name of the generated executable file. |