matlab.addons.enableAddon
启用已安装的附加功能
语法
说明
matlab.addons.enableAddon(
启用具有指定标识符的附加功能。identifier
)
示例
从已安装的附加功能列表中启用附加功能
假设您的系统上安装了一个名为 Random File Name Creator
的附加功能。获取已安装的附加功能列表,然后启用 Random File Name Creator
附加功能。
获取已安装的附加功能列表。
addons = matlab.addons.installedAddons
addons = 1×4 table Name Version Enabled Identifier ___________________________ _________ _______ ______________________________________ "Random File Name Creator" "1.0" false "75442144-f751-4011-bf0e-32b6fb2f1433"
查看 Random File Name Creator
附加功能是否处于禁用状态。MATLAB 确认该附加功能已被禁用。
matlab.addons.isAddonEnabled('Random File Name Creator')
ans = logical 0
启用 Random File Name Creator
附加功能,然后确认它已启用。
matlab.addons.enableAddon('Random File Name Creator') matlab.addons.isAddonEnabled('Random File Name Creator')
ans = logical 1
切换到附加功能的以前版本
假设您的系统上安装了名为 My Toolbox
的附加功能的两个版本:2.0
和 4.0
。版本 4.0
已启用。通过启用版本 2.0
切换到使用附加功能的版本 2.0
。
获取已安装的附加功能列表。
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"
通过指定返回的标识符列表中的第二项启用 My Toolbox
的版本 2.0
。MATLAB 启用版本 2.0
并禁用 My Toolbox
的版本 4.0
。
matlab.addons.enableAddon(addons.Identifier(2),'2.0')
addons = matlab.addons.installedAddons
addons = 2×4 table Name Version Enabled Identifier ___________________________ _________ _______ ______________________________________ "My Toolbox_v4.0" "4.0" false "6de8682e-9c3c-407e-bad7-aa103d738d08" "My Toolbox" "2.0" true "6de8682e-9c3c-407e-bad7-aa103d738d08"
输入参数
name
— 附加功能的名称
字符向量 | 字符串
要启用的附加功能的名称,指定为字符向量或字符串。要确定附加功能的名称,请使用 matlab.addons.installedAddons
函数。
identifier
— 附加功能的唯一标识符
字符向量 | 字符串
要启用的附加功能的唯一标识符,指定为字符向量或字符串。要确定附加功能的唯一标识符,请使用 matlab.addons.installedAddons
函数。
version
— 附加功能的版本
字符向量 | 字符串
要禁用的附加功能的版本,指定为字符向量或字符串。要确定附加功能的版本,请使用 matlab.addons.installedAddons
函数。
版本历史记录
在 R2017b 中推出
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)