Contenu principal

matlab.addons.install

R2026b

(Not recommended) Install add-on

matlab.addons.install is not recommended. Use mpminstall instead. (since R2026b) For information on updating your code, see Version History.

Description

newAddon = matlab.addons.install(fileName) 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, see Get and Manage Add-Ons.

matlab.addons.install only supports installing toolboxes.

example

newAddon = matlab.addons.install(fileName,installOption) installs the add-on without overwriting previously installed versions if installOption is 'add'. Otherwise, if a version of the add-on is already installed, MATLAB overwrites the previous version.

example

Examples

collapse all

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

collapse all

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 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

collapse all

New add-on information, returned as a table with these columns.

FieldDescriptionType
NameName of the add-onString scalar
VersionVersion of the add-onString scalar
EnabledWhether the add-on is enabledLogical
IdentifierUnique identifier of the add-onString Scalar

Tips

  • Installing an add-on using the matlab -batch command is not supported. To install an add-on from a script, run MATLAB interactively using the matlab -r command instead. For more information, see matlab (Windows), matlab (Linux), or matlab (macOS).

Version History

Introduced in R2018b

expand all