Main Content

matlab.addons.toolbox.installToolbox

Install toolbox file

Description

installedToolbox = matlab.addons.toolbox.installToolbox(toolboxFile) installs the toolbox file (.mltbx file) specified by toolboxFile and returns information about the toolbox.

MATLAB® installs the toolbox 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.

example

installedToolbox = matlab.addons.toolbox.installToolbox(toolboxFile,agreeToLicense) accepts the license agreement before installing the toolbox if agreeToLicense is true.

example

Examples

collapse all

Assume that you have the myToolbox.mltbx toolbox file in your current working folder. Install the toolbox.

toolboxFile = 'MyToolbox.mltbx';
installedToolbox = matlab.addons.toolbox.installToolbox(toolboxFile)
installedToolbox = 

       Name: 'myToolbox'
    Version: '2.0'
       Guid: 'd0169b4a-fe74-463f-981a-26160c94cbe5'

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

Assume that you have the myToolbox.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\MyToolbox.mltbx';
agreeToLicense = true;
installedToolbox = matlab.addons.toolbox.installToolbox(toolboxFile,agreeToLicense)
installedToolbox = 

       Name: 'myToolbox'
    Version: '2.0'
       Guid: 'd0169b4a-fe74-463f-981a-26160c94cbe5'

Input Arguments

collapse all

Name of the toolbox file (.mltbx file), specified as a character vector or string scalar. The name includes the relative or absolute path to the file.

Example: toolboxFile = 'myToolbox.mltbx'

Example: toolboxFile = "C:\Work\myOtherToolbox.mltbx"

Indicator to accept license agreement, specified as false or true. By default, agreeToLicense is false. If a toolbox contains a license agreement:

  • If agreeToLicense is false, then MATLAB displays a dialog box where you can accept the license or cancel installation.

  • If agreeToLicense is true, then MATLAB installs the toolbox without opening the license agreement dialog box. By setting agreeToLicense to true, you accept the terms of the license agreement. Be sure that you have reviewed the license agreement before installing the toolbox.

If a toolbox does not have a license agreement, the value of agreeToLicense has no effect on installation.

Data Types: logical

Output Arguments

collapse all

Information about the installed toolbox, returned as a structure. The structure has the following fields.

FieldDescription
NameName of the toolbox
VersionToolbox version
GuidUnique toolbox identifier

Alternatives

You can install toolboxes from the Add-On Explorer UI. For more information, see Get and Manage Add-Ons.

Version History

Introduced in R2016a