Main Content

matlab.addons.toolbox.installToolbox

Install toolbox file

Description

example

installedToolbox= matlab.addons.toolbox.installToolbox(toolboxFile)installs the toolbox file (.mltbxfile) specified bytoolboxFileand 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, seeGet and Manage Add-Ons.

example

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

Examples

collapse all

Assume that you have themyToolbox.mltbxtoolbox 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 themyToolbox.mltbxtoolbox file in yourC:\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 (.mltbxfile), 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 asfalseortrue. By default,agreeToLicenseisfalse. If a toolbox contains a license agreement:

  • IfagreeToLicenseisfalse,然后用MATLAB将显示一个对话框,您可以accept the license or cancel installation.

  • IfagreeToLicenseistrue, then MATLAB installs the toolbox without opening the license agreement dialog box. By settingagreeToLicensetotrue, 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 ofagreeToLicensehas 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.

Field Description
Name Name of the toolbox
Version Toolbox version
Guid Unique toolbox identifier

Alternatives

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

Introduced in R2016a