| Contents | Index |
mcc -win32 -W 'excel:component_name,class_name,major.minor' [-b] [-T link:lib file1..[filen]] [-d output_dir_path] [-u ] mcc -B 'cexcel:component_name,class_name,major.minor' [-d output_dir_path] [-u ]
mcc is the MATLAB command that invokes MATLAB Compiler. You can issue the mcc command either from the MATLAB command prompt (MATLAB mode) or the DOS or UNIX® command line (standalone mode).
The -W option is used when running mcc with the builder.
Note For a complete list of all mcc command options, see mcc in the MATLAB Compiler User's Guide documentation. |
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 Elements | Description |
|---|---|
| cexcel: | Keyword that tells the compiler to create an Excel component using the bundle file option. |
| component_name | Specifies the name of the component to be created. |
| class_name | Specifies the name of the class to be created. If you do not specify the class name, mcc uses the component name as the default. |
| major | Specifies 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. |
| minor | Specifies 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. |
(Optional) Generates an Excel compatible formula function for each MATLAB file.
(Optional) Tells the builder to create a folder and copy the output files to it. If you use mcc instead of the Deployment Tool, the project_folder\src and project_folder\distrib folders are not automatically created.
The example creates a component called my_component containing a single class named my_class with methods foo and bar.
If and when multiple instances of my_class are instantiated in an application, only one MCR is initialized, and it is shared by all instances of my_class.
(Optional) Tells the compiler to create a DLL. Specify the keyword link:lib, which links objects into a shared library (DLL).
Tells the compiler to not auto-register the COM component or Microsoft Excel add-in for the current user.
This can be helpful when a user wants to ensure the component is registered for specific privileges (such as administrator, for example).
See Deployable Component Creation and Add-in and COM Component Registration in the Getting Started chapter of this User's Guide for more information.
Tells the compiler to create an Excel wrapper. This option takes a string argument that specifies the following characteristics of the component.
| -W String Elements | Description |
|---|---|
| excel: | Keyword that tells the compiler the type of component to create, followed by a colon. Specify excel to create an Excel component. |
| component_name | Specifies the name of the component to be created. |
| class_name | Specifies the name of the class to be created. If you do not specify the class name, mcc uses the component name as the default. |
| major | Specifies 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. |
| minor | Specifies 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. |
mcc -S -W 'java:mycomponent,myclass' foo.m bar.m
The example creates a Java component called mycomponent containing a single Java class named myclass with methods foo and bar. (See the first example in this table)
If and when multiple instances of myclass are instantiated in an application, only one MCR is initialized, and it is shared by all instances of myclass.
Note All of these command-line examples produce the mycomponent.jar file (component jar file). Notice that the component name used to create these files is derived from the last item on the period-separated list that specifies the fully qualified name of the class. |
Use this option to build a 32-bit application on a 64-bit system only when the following are both true:
You use the same MATLAB installation root (install_root) for both 32-bit and 64-bit versions of MATLAB.
You are running from a Windows command line (not a MATLAB command line).
mcc -W 'excel:mycomponent,myclass,1.0' -T link:lib
foo.m bar.mThis 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.
mcc -W -u 'excel:mycomponent,myclass,1.0' -T link:lib
foo.m bar.mIn this example, the add-in generated by this build command will only be registered to the current user on the development machine. This behavior is contrary to the default behavior to auto-register the add-in or COM component to administrator.
See Deployable Component Creation and Add-in and COM Component Registration in the Getting Started chapter of this user's guide for more information.
mcc -W 'excel:mycomponent,myclass,1.0' -b -T link:lib
foo.m bar.mTo generate an Excel compatible formula function for each MATLAB file, specify the -b option.
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.

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |