mcc - Invoke MATLAB® Compiler™

Syntax

mcc -W 'excel:component_name,class_name,major.minor'
[-b] [-T link:lib file1..[filen]]
[-d output_dir_path] 


mcc -B 'cexcel:component_name,class_name,major.minor'
[-d output_dir_path]

Description

mcc is the MATLAB® command that invokes the MATLAB Compiler product. You can issue the mcc command either from the MATLAB command prompt (MATLAB mode) or the DOS or UNIX® command line (standalone mode).

Options

The -W option is used when running mcc with the builder.

-W

Tells the compiler to create an Excel® wrapper. This option takes a string argument that specifies the following characteristics of the component.

-W String ElementsDescription
excel:Keyword that tells the compiler the type of component to create, followed by a colon. Specify excel to create an Excel component.
component_nameSpecifies the name of the component to be created.
class_nameSpecifies the name of the class to be created. If you do not specify the class name, mcc uses the component name as the default.
majorSpecifies the major version number (for example, 1 in 1.0). If you do not specify a version number, mcc uses the latest version built or 1.0, if there is no previous version.
minorSpecifies the minor version number (for example, 0 in 1.0). If you do not specify a version number, mcc uses the latest version built or 1.0, if there is no previous version.

[-d output_dir_path]

(Optional) Tells builder to create a directory and copy the output files to it. If you use mcc instead of the Deployment Tool, the project_directory\src and project_directory\distrib directories are not automatically created.

[-T link:lib file1..[filen]]

(Optional) Tells the compiler to create a DLL. Specify the keyword link:lib, which links objects into a shared library (DLL).

[-b]

(Optional) Generates an Excel-compatible formula function for each M-file.

-B

Tells the compiler to use the cexcel bundle file option to simplify command line entry. By using this alternative to the -W option, the -T or the -b options do not need to be specified.

-B String ElementsDescription
cexcel:Keyword that tells the compiler to create an Excel component using the bundle file option.
component_nameSpecifies the name of the component to be created.
class_nameSpecifies the name of the class to be created. If you do not specify the class name, mcc uses the component name as the default.
majorSpecifies the major version number (for example, 1 in 1.0). If you do not specify a version number, mcc uses the latest version built or 1.0, if there is no previous version.
minorSpecifies the minor version number (for example, 0 in 1.0). If you do not specify a version number, mcc uses the latest version built or 1.0, if there is no previous version.

[-d output_dir_path]

(Optional) Tells builder to create a directory and copy the output files to it. If you use mcc instead of the Deployment Tool, the project_directory\src and project_directory\distrib directories are not automatically created.

Examples

Using -W To Create an Excel® Component

mcc -W 'excel:mycomponent,myclass,1.0' -T link:lib foo.m bar.m

This example shows the mcc command used to create a COM component called mycomponent containing single COM class named myclass with methods foo and bar, and a version of 1.0 (note both major and minor versions are coded). The -T option tells mcc to create a DLL.

Using -b To Create a Function For Each M-file

mcc -W 'excel:mycomponent,myclass,1.0' -b -T link:lib foo.m bar.m

To generate an Excel-compatible formula function for each M-file, specify the -b option.

Using -B To Simplify Command Input

mcc -B 'cexcel:mycomponent,myclass,1.0' foo.m bar.m

As an alternative to using the excel keyword, use the cexcel bundle file option to simplify command line input. In the example, note how you do not need to specify the -T or the -b options when using -B.

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS