-一种
将文件添加到可部署的存档使用-一条路径
要指定要添加的文件。多-一种
允许的选项。
如果a file name is specified with-一种
,编译器在MATLAB路径上查找这些文件,因此指定完整路径名是可选的。这些文件未通过MBUILD.
,因此您可以包含数据文件等文件。
如果使用该文件夹名称-一种
选项,这是entire contents of that folder are added recursively to the deployable archive. For example,
mcc -m hello.m -a ./testdir
指定所有文件Testdir.
以及其子文件夹中的所有文件都将添加到可部署的存档中。文件夹子树Testdir.
保留在可部署的存档中。
如果文件名包括通配符模式,则仅添加与模式匹配的文件夹中的文件添加到可在可部署的存档中,并且不递归地处理给定路径的子文件夹。例如,
mcc -m hello.m -a ./testdir/*
指定所有文件./testdir.
are added to the deployable archive and subfolders under./testdir.
没有递归地处理。
mcc -m hello.m -a ./testdir/*.m
指定具有扩展名的所有文件.m
下./testdir.
are added to the deployable archive and subfolders of./testdir.
没有递归地处理。
注意
*
is the only supported wildcard.
将文件添加到存档时使用-一种
that do not appear on the MATLAB path at the time of compilation, a path entry is added to the application's run-time path so that they appear on the path when the deployed code executes.
当你使用的时候-一种
选项要指定资源的完整路径,则保留基本路径,具有一些修改,而是相对于运行时缓存目录的子目录,而不是用户本地文件夹。第一次执行应用程序,从可部署的存档创建缓存目录。你可以使用是isdeployed.
(MATLAB Compiler SDK)函数来确定应用程序是否正在部署模式下运行,并相应地调整路径。该-一种
选项也创造了一个.Auth.
授权目的文件。
Caution
如果你使用-一种
flag to include a file that is not on the MATLAB path, the folder containing the file is added to the MATLAB dependency analysis path. As a result, other files from that folder might be included in the compiled application.
注意
如果你使用-一种
标志要包含自定义Java类,独立应用程序工作无需更改classpath
as long as the Java class is not a member of a package. The same applies for JAR files. However, if the class being added is a member of a package, the MATLAB code needs to make an appropriate call tojavaaddpath.
至update theclasspath
使用包的父文件夹。
-B.
生成一个Visual Basic®文件(.bas.
)containing the微软Excel.公式函数接口到COM对象生成的MATLAB Compiler。When imported into the workbook Visual Basic code, this code allows the MATLAB function to be seen as a cell formula function.
-B.
Replace the file on theMCC.
命令行与指定文件的内容。采用
捆绑文档名称
should contain onlyMCC.
命令行选项和相应的参数和/或其他文件名。该文件可能包含其他-B.
选项。一种bundle can include replacement parameters for compiler options that accept names and version numbers. See使用捆绑包构建MATLAB代码(MATLAB Compiler SDK)。
-C
When used in conjunction with the-L.
option, suppresses compiling and linking of the generated C wrapper code. The-C
选项不能独立使用-L.
option.
-C
不要在二进制文件中嵌入可部署的存档。
-D.
Place output in a specified folder. Use
指导生成的文件外档
。
-F
Override the default options file with the specified options file. It specifically applies to the C/C++ shared libraries, COM, and Excel targets. Use
至specify文档名称
作为选项文件调用时MBUILD.
。此选项允许您对编译器的不同调用使用不同的ANSI编译器。此选项是直接通行证MBUILD.
。
-G
那-G
Include debugging symbol information for the C/C++ code generated byMatlab Compiler SDK.。它也会产生MBUILD.
将适当的调试标志传递给系统C / C ++编译器。Debug选项允许您回溯到最终可以识别故障在初始化中是否发生的点MATLAB Runtime,函数调用或终止例程。此选项不会让您使用C / C ++调试器调试Matlab文件。
-一世
将新的文件夹路径添加到包含的文件夹列表中。每-一世
选项将文件夹附加到要搜索的路径列表的末尾。例如,
设置搜索路径,以便目录1
is searched first for MATLAB files, followed bydirectory2.
。此选项对于独立编译非常重要,Matlab Path不可用。
如果与之结合使用-N
选项,这是-一世
option adds the folder to the compilation path in the same position where it appeared in the MATLAB path rather than at the head of the path.
k
直接MCC.
如果由于错误而过早地结束,则不会删除输出文件。
该default behavior ofMCC.
如果命令未能成功执行,则要处理任何部分输出。
-M.
直接MCC.
至generate a standalone application.
-M.
定义编译时选项。采用
通过串
直接到MBUILD.
。此选项提供了一个有用的机制,用于定义编译时选项,例如,-m“-dmacro =值”
。
注意
多-M.
选项不会累积;只有最右边的-M.
使用选项。
-N
该-N
选项自动识别数字命令行输入并将其视为Matlab双打。
-N
通过-N
clears the path of all folders except the following core folders (this list is subject to change over time):
通过-N
还保留在编译时在Matlab路径上显示的此列表中的所有子文件夹。包含-N
在命令行上,允许您从原始路径中替换文件夹,同时保留包含的文件夹的相对排序。还包括出现在原始路径上的包含包含文件夹的所有子文件夹。除此之外-N
选项保留您在路径上包含的所有文件夹matlabroot.
\工具箱
。
使用时-N
选项,使用-一世
选项以强制包含一个文件夹,该文件夹放置在编译路径的头部。使用-P.
有条件地包括文件夹及其子文件夹的选项;如果它们存在于MATLAB路径中,则它们以相同的顺序显示在编译路径中。
-O
指定最终可执行文件的名称(仅限独立应用程序)。采用
命名最终的可执行输出MATLAB Compiler。一种suitable platform-dependent extension is added to the specified name (for example,。exe
适用于Windows独立应用程序)。
-P.
采用in conjunction with the option-N
添加特定文件夹和子文件夹matlabroot.
\工具箱
编译matlab路径。这些文件以与MATLAB路径中显示的相同顺序添加。使用语法
哪里目录
是要包含的文件夹。如果目录
不是绝对路径,假设在当前工作文件夹下。
-R.
嵌入二进制文件中的资源图标。
-R.
提供MATLAB Runtime选项。此选项仅在使用Matlab编译器构建独立应用程序时才相关。语法如下:
选项 |
Description |
目标 |
-L.ogfile,文档名称 |
Specify a log file name. |
MATLAB Compiler |
-Nodisplay. |
抑制matlab.nodisplay. run-time warning. |
MATLAB Compiler |
-nojvm. |
Do not use the Java Virtual Machine (JVM). |
MATLAB Compiler |
-startmsg. |
Customizable user message displayed at initialization time. |
MATLAB Compiler独立应用s |
-Completemsg |
Customizable user message displayed when initialization is complete. |
MATLAB Compiler独立应用s |
Caution
When running onMac OS X.那如果you use-Nodisplay.
作为包含在内的选项之一mclInitializeApplication
, 然后the call tomclInitializeApplication
must occur before calling麦克伦曼
。
注意
如果您指定了-R.
从Matlab Compiler SDK创建的库的选项,MCC.
仍然没有错误编译并生成结果。但是-R.
选项不适用于这些库,并且不做任何事情。
-
标准行为MATLAB Runtime是班级的每个实例都有自己的MATLAB Runtime背景。该上下文包括用于变量的全局MATLAB工作空间,例如类中每个函数的路径和基本工作空间。如果创建了多个类的实例,则每个实例都会获得一个独立的上下文。这可确保在类的一个实例中对全局或基础工作空间所做的更改不会影响同一类的其他实例。
在单身人士MATLAB Runtime一个类的所有实例共享的上下文。如果multiple instances of a class are created, they use the context created by the first instance which saves startup time and some resources. However, any changes made to the global workspace or the base workspace by one instance impacts all class instances. For example, ifinstance1
创建一个全局变量一种
在单身人士MATLAB Runtime, 然后instance2
可以使用变量一种
。
单身MATLAB Runtimeis only supported by the following products on these specific targets:
单身支持的目标金宝appMATLAB Runtime |
Create a SingletonMATLAB Runtime通过.... |
excel.add-in |
目标的默认行为是单例MATLAB Runtime。您无需执行其他步骤。 |
。NET assembly |
目标的默认行为是单例MATLAB Runtime。您无需执行其他步骤。 |
COM组件 |
|
Java package |
-T.
指定输出目标阶段和类型。
使用语法-T.target
至define the output type.
目标 |
Description |
编译:exe. |
生成C / C ++包装文件,并将C / C ++文件编译为适合链接到独立应用程序的对象表单。 |
编译:lib |
生成C / C ++包装文件,并将C / C ++文件编译为适合链接到共享库或DLL的对象表单。 |
链接:exe. |
和...一样编译:exe. 并将对象文件链接到独立应用程序中。 |
链接:lib |
和...一样编译:lib 并将对象文件链接到共享库或DLL中。 |
-U
Register COM component for the current user only on the development machine. The argument applies only to the generic COM component and微软Excel.add-in targets.
-U
构建可部署的存档(。ctf
文件)for.MATLAB生产服务器。
-v.
显示编译步骤,包括:
该-v.
选项通过了-v.
option toMBUILD.
并显示有关的信息MBUILD.
。
-W.
显示警告消息。使用语法
控制警告的显示。
句法 |
Description |
-W列表 |
列出具有缩写标识符的编译时警告以及其状态。 |
-w启用 |
启用所有编译时警告。 |
-W.禁用[: ] |
禁用与之相关的特定编译时间警告 。省略可选 申请禁用 action to all compile-time warnings. |
-w启用[: ] |
启用与之相关的特定编译时警告 。省略可选 申请enable action to all compile-time warnings. |
-W.error[: ] |
Treat specific compile-time warnings associated with 作为错误。省略可选 申请error action to all compile-time warnings. |
-w关闭[: ] |
关闭警告,针对由此定义的特定错误消息 。省略可选 申请关闭 对所有运行时的行动。 |
-w [: ] |
打开与之相关的运行时警告 。省略可选 申请上 对所有运行时的行动。 |
您还可以在Matlab代码中打开或关闭警告。
例如,至turn off warnings for deployed applications (specified using是isdeployed.
)在初创物
, 你写:
如果是isdeployed.warning off end
要打开部署应用程序的警告,请写:
您还可以指定多个-W.
选项。
例如,如果you want to disable all warnings except重复_file.
, 你写:
指定多个时-W.
选项,它们从左到右处理。
-W.
控制功能包装的生成。使用语法
控制函数包装的生成,用于编译器生成的MATLAB文件集合。您提供了一个函数列表,编译器生成包装器函数和任何适当的全局变量定义。
-X
采用-X
在依赖性分析期间忽略公共MATLAB文件I / O功能读取的数据文件。对于MATLAB文件I / O函数的列表,当您使用时忽略其数据文件-X
选项,参见一种pp Packaging Dependency Analysis。有关如何使用的详细信息-X
选项,参见%#排除
。
- 我
采用
覆盖具有指定参数的默认许可文件。
注意
该- 我
标志仅适用于命令行模式。
>>!MCC -M Foo.m -y License.lic