Main Content

mcc Command Arguments Listed Alphabetically


Display help message.

Cannot be used in a deploytool app.

-a path

Add path to the deployable archive.

If you specify a folder name, all files in the folder are added. If you use a wildcard (*), all files matching the wildcard are added.


Generate Excel® compatible formula function.

Requires MATLAB® Compiler™ for Excel add-ins. Cannot be used in a deploytool app.

-B filename[:arg[,arg]]

Replace -B filename on the mcc command line with the contents of filename.

The file should contain only mcc command-line options. These are MathWorks included options files:

  • -B csharedlib:foo (C shared library)

  • -B cpplib:foo (C++ library)

Cannot be used in a deploytool app.


Generate C wrapper code.

Equivalent to -T codegen.


Direct mcc to not embed the deployable archive in generated binaries.

-d directory

Place output in specified folder.

The specified folder must already exist. Cannot be used in a deploytool app.

Suppresses appearance of the MS-DOS Command Window when generating a standalone application.

Use -e in place of the -m option. Available for Windows® only. Use with -R option to generate error logging. Equivalent to -W WinMain -T link:exe. Cannot be used in a deploytool app.

The standalone app compiler suppresses the MS-DOS command window by default. To enable it, deselect Do not display the Windows Command Shell (console) for execution in the Additional Runtime Settings area.

-f filename

Use the specified options file, filename, when calling mbuild.

mbuild -setup is recommended.


Generate debugging information.


Same as -g.

-I directory

Add folder to search path for MATLAB files.


Directs mcc to not delete output files if the compilation ends prematurely, due to error.

Default behavior is to dispose of any partial output if the command fails to execute successfully.


Create a function library.

Equivalent to -W lib -T link:lib. Cannot be used in a deploytool app.


Generate a standalone application.

Equivalent to -W main -T link:exe. Cannot be used in a deploytool app.

-M string

Pass string to mbuild.

Use to define compile-time options.


Automatically treat numeric inputs as MATLAB doubles.

Cannot be used in a deploytool app.


Clear the path of all but a minimal, required set of folders.

Uses the following folders:

  • matlabroot\toolbox\matlab

  • matlabroot\toolbox\local

  • matlabroot\toolbox\compiler

  • matlabroot\toolbox\shared\bigdata

-o outputfile

Specify name of final output file.

Adds appropriate extension. Cannot be used in a deploytool app.

-p directory

Add folder to compilation path in an order-sensitive context.

Requires -N option.

-R option

Specify run-time options for MATLAB Runtime.

Valid only for standalone applications using MATLAB Compiler.

option = -nojvm, -nodisplay, '-logfile filename', -startmsg, and -completemsg filename


Obfuscate folder structures and file names in the deployable archive (.ctf file) from the end user.


Create singleton MATLAB Runtime.

Default for generic COM components. Valid for Microsoft® Excel and Java® packages.


Specify the output target phase and type.

Default is codegen. Cannot be used in a deploytool app.


Registers COM component for current user only on development machine.

Valid only for generic COM components and Microsoft Excel add-ins.


Verbose; display compilation steps.


-w option

Display warning messages.

option = list, level, or level:string


level = disable, enable, error, off:string, or on:string

-W type

Control the generation of function wrappers.

type = main cpplib:<string> lib:<string> none com:compname,clname,version

Cannot be used in a deploytool app.


Ignore data files detected by dependency analysis.For more information, see Dependency Analysis Using MATLAB Compiler.
-Y licensefile

Use licensefile when checking out a MATLAB Compiler license.

The -Y flag works only with the command-line mode.

>>!mcc -m foo.m -Y license.lic
-Z optionSpecify method of including support packages.

option = 'autodetect' (default), 'none', or packagename.

Packaging Log and Output Folders

By default, the deployment app places the packaging log and the Testing Files, End User Files, and Packaged Installers folders in the target folder location. If you specify a custom location, the app creates any folders that do not exist at compile time.