Main Content

matlab.addons.isAddonEnabled

Determine if add-on is enabled

Description

example

isenabled = matlab.addons.isAddonEnabled(name)returnstrueif the add-on with the specified name is enabled. Otherwise, it returnsfalse.

If multiple versions of an add-on are installed, you must specify aversion.

example

isenabled = matlab.addons.isAddonEnabled(identifier)returnstrueif the add-on with the specified identifier is enabled. Otherwise, it returnsfalse.

example

isenabled = matlab.addons.isAddonEnabled(___,version)also specifies the version of the add-on. Use this syntax with any of the arguments in previous syntaxes.

Examples

collapse all

Suppose that you have an add-on calledRandom File Name Creatorinstalled on your system. Get the list of installed add-ons and determine ifRandom File Name Creatoris enabled.

Get the list of installed add-ons.

addons = matlab.addons.installedAddons
addons = 1×4 table Name Version Enabled Identifier ___________________________ _________ _______ ______________________________________ "Random File Name Creator" "1.0" true "75442144-f751-4011-bf0e-32b6fb2f1433"

Determine ifRandom File Name Creatoris enabled. MATLAB®confirms that the add-on is enabled.

matlab.addons.isAddonEnabled('Random File Name Creator')
ans = logical 1

Suppose that you have versions2.0and4.0of an add-on calledMy Toolboxinstalled on your system. Disable version4.0of the add-on and confirm that it is disabled.

Get the list of installed add-ons.

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"

DisableMy Toolboxversion4.0by specifying the first item in the returned list of identifiers. Then, confirm that it is disabled.

matlab.addons.disableAddon(addons.Identifier(1),'4.0') matlab.addons.isAddonEnabled(addons.Identifier(1),'4.0')
ans = logical 0

Input Arguments

collapse all

Name of the add-on, specified as a character vector or string. To determine the name of an add-on, use thematlab.addons.installedAddonsfunction.

Unique identifier of the add-on, specified as a character vector or string. To determine the unique identifier of an add-on, use thematlab.addons.installedAddonsfunction.

Version of the add-on, specified as a character vector or string. To determine the version of an add-on, use thematlab.addons.installedAddonsfunction.

版本历史

Introduced in R2017b