matlab.addons.install - Install add-on - MATLAB (original) (raw)
Syntax
Description
[newAddon](#mw%5F4705cd9f-c0cf-4109-989e-f7d2c2bac524) = matlab.addons.install([fileName](#mw%5Fb235764c-2a2a-4d6b-816e-981c62a80803))
installs the add-on specified by fileName
. If a version of the add-on is already installed, MATLAB® overwrites the previous version.
MATLAB installs the add-on in the default add-on installation folder. For more information including how to change the default add-on installation folder, seeGet and Manage Add-Ons.
matlab.addons.install
only supports installing toolboxes.
[newAddon](#mw%5F4705cd9f-c0cf-4109-989e-f7d2c2bac524) = matlab.addons.install([fileName](#mw%5Fb235764c-2a2a-4d6b-816e-981c62a80803),[agreeToLicense](#mw%5F66c8d2c9-1bef-4e9f-a652-797aa37d7375))
accepts the license agreement before installing the add-on ifagreeToLicense
is true
.
[newAddon](#mw%5F4705cd9f-c0cf-4109-989e-f7d2c2bac524) = matlab.addons.install([fileName](#mw%5Fb235764c-2a2a-4d6b-816e-981c62a80803),[installOption](#mw%5F999752d4-9a8b-484f-bf33-0b94c2c10e10))
installs the add-on without overwriting previously installed versions ifinstallOption
is 'add'
. Otherwise, if a version of the add-on is already installed, MATLAB overwrites the previous version.
[newAddon](#mw%5F4705cd9f-c0cf-4109-989e-f7d2c2bac524) = matlab.addons.install([fileName](#mw%5Fb235764c-2a2a-4d6b-816e-981c62a80803),[agreeToLicense](#mw%5F66c8d2c9-1bef-4e9f-a652-797aa37d7375),[installOption](#mw%5F999752d4-9a8b-484f-bf33-0b94c2c10e10))
installs the add-on using the specified license and install options.
Examples
Assume that you have the My toolbox.mltbx
toolbox file in your C:\Downloads\
folder, and that the toolbox contains a license agreement. Install the toolbox and prevent MATLAB from opening the license agreement dialog box by indicating you accept the license.
toolboxFile = 'C:\Downloads\My toolbox.mltbx'; agreeToLicense = true; matlab.addons.install(toolboxFile,agreeToLicense)
Verify that the toolbox is installed.
addons = matlab.addons.installedAddons
addons =
1×4 table
Name Version Enabled Identifier
___________________________ _________ _______ ______________________________________
"My Toolbox" "2.0" true "6de8682e-9c3c-407e-bad7-aa103d738d08"
Suppose that you have version 2.0
of a toolbox called My Toolbox
installed on your system. Install version 4.0
of the toolbox without overwriting version 2.0
.
Assume that you have the 'My toolbox_v4.0.mltbx'
toolbox file in your current working folder. Install the toolbox without overwriting the existing installed version by specifying that you want to add the toolbox.
toolboxFile = 'My toolbox_v4.0.mltbx'; installOption = 'add'; matlab.addons.install(toolboxFile, installOption)
ans =
1×4 table
Name Version Enabled Identifier
_________________ _______ _______ ______________________________________
"My toolbox_v4.0" "4.0" true "6de8682e-9c3c-407e-bad7-aa103d738d08"
If the toolbox contains a license agreement, a dialog box opens to prompt you to agree to the license before installation.
Verify that the previous version of the toolbox is still installed.
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"
Input Arguments
File name to install, specified as a character vector or string. File name must be a valid toolbox installation file (*.mltbx
). You can specify the file name as an absolute or relative path.
Whether to accept license agreement, specified as true
or false
. By default, agreeToLicense
is false
.
If an add-on contains a license agreement:
- If
agreeToLicense
isfalse
, then MATLAB displays a dialog box where you can accept the license or cancel installation. - If
agreeToLicense
istrue
, then MATLAB installs the add-on without opening the license agreement dialog box. By settingagreeToLicense
totrue
, you accept the terms of the license agreement. Be sure that you have reviewed the license agreement before installing the add-on.
If an add-on does not have a license agreement, the value ofagreeToLicense
has no effect on installation.
Whether to overwrite or add the add-on, specified as'overwrite'
or 'add'
. By default,installOption
is set to'overwrite'
.
If a version of an add-on is already installed:
- If
installOption
is'overwrite'
, then MATLAB overwrites all previously installed versions of the add-on. - If
installOption
is'add'
, then MATLAB installs the add-on without overwriting previously installed versions.
Output Arguments
New add-on information, returned as a table with these columns.
Field | Description | Type |
---|---|---|
Name | Name of the add-on | String scalar |
Version | Version of the add-on | String scalar |
Enabled | Whether the add-on is enabled | Logical |
Identifier | Unique identifier of the add-on | String Scalar |
Version History
Introduced in R2018b