Main Content

matlab.addons.install

安装附加组件

描述

例子

纽阿登= matlab.addons.install(文件名installs the add-on specified by文件名。如果a version of the add-on is already installed, MATLAB®overwrites the previous version.

MATLAB在默认的附加安装文件夹中安装附加组件。有关更多信息,包括如何更改默认的附加安装文件夹,请参阅获取并管理附加组件

matlab.addons.install仅支持安装万博1manbetx工具箱。

例子

纽阿登= matlab.addons.install(文件名,,,,agreeToLicense在安装附加组件之前,请接受许可协议agreeToLicensetrue

例子

纽阿登= matlab.addons.install(文件名,,,,安装安装附加组件,而无需覆盖以前安装的版本安装'添加'。否则,如果已经安装了附加组件的版本,则MATLAB覆盖上一个版本。

纽阿登= matlab.addons.install(文件名,,,,agreeToLicense,,,,安装使用指定的许可证和安装选项安装附加组件。

例子

全部收缩

假设你有My toolbox.mltbx您的工具箱文件C:\ downloads \文件夹,该工具箱包含许可协议。安装工具箱,并通过指示您接受许可证来防止MATLAB打开“许可协议”对话框。

ToolboxFile ='c:\ downloads \ my toolbox.mltbx';agreeToLicense = true; matlab.addons.install(toolboxFile,agreeToLicense)

验证工具箱已安装。

addons = matlab.addons.installedaddons
addons = 1×4 table Name Version Enabled Identifier ___________________________ _________ _______ ______________________________________ "My Toolbox" "2.0" true "6de8682e-9c3c-407e-bad7-aa103d738d08"

假设您有版本2.0of a toolbox calledMy Toolbox安装在系统上。安装版本4.0工具箱的无覆盖版本2.0

假设你有'My toolbox_v4.0.mltbx'当前工作文件夹中的工具箱文件。通过指定要添加工具箱,安装工具箱而无需覆盖现有的已安装版本。

ToolboxFile ='My toolbox_v4.0.mltbx';installOption ='添加';matlab.addons.install(toolboxFile, installOption)
ANS = 1×4表版本启用标识符___________________________________________________________________________________________________________________________

如果the toolbox contains a license agreement, a dialog box opens to prompt you to agree to the license before installation.

验证工具箱的先前版本仍在安装中。

addons = matlab.addons.installedaddons
addons = 2×4 table Name Version Enabled Identifier ___________________________ _________ _______ ______________________________________ "My Toolbox_v4.0" "4.0" true "6de8682e-9c3c-407e-bad7-aa103d738d08" "My Toolbox" "2.0" false "6de8682e-9c3c-407e-bad7-aa103d738d08"

输入参数

全部收缩

要安装的文件名,指定为字符向量或字符串。文件名必须是有效的工具箱安装文件(*.mltbx)。您可以将文件名指定为绝对路径或相对路径。

是否接受许可协议,指定为trueor错误的。默认,agreeToLicense错误的

如果附加组件包含许可协议:

  • 如果agreeToLicense错误的,,,,then MATLAB displays a dialog box where you can accept the license or cancel installation.

  • 如果agreeToLicensetrue,,,,then MATLAB installs the add-on without opening the license agreement dialog box. By settingagreeToLicensetrue,您接受许可协议的条款。在安装附加组件之前,请确保您已经审查了许可协议。

如果an add-on does not have a license agreement, the value ofagreeToLicense对安装没有影响。

是覆盖还是添加附加组件,指定为“覆盖”or'添加'。默认,安装是set to“覆盖”

如果已经安装了附加组件的版本:

  • 如果安装“覆盖”,然后用MATLAB覆盖所有以前安装的versions of the add-on.

  • 如果安装'添加',然后MATLAB安装附加组件,而无需覆盖先前安装的版本。

输出参数

全部收缩

新的附加信息,返回的这些列,返回。

场地 描述 Type
姓名 附加组件的名称 字符串标量
版本 附加组件的版本 字符串标量
已启用 是否启用了附加组件 逻辑
标识符 附加组件的唯一标识符 字符串标量

版本历史记录

在R2018B中引入