Main Content

matlab.addons.uninstall

卸载附加功能

说明

示例

matlab.addons.uninstall(name) 卸载具有指定名称的附加功能。您可以卸载来自 MATLAB® 用户社区的大多数附加功能。不支持卸载 MathWorks® 产品和支持包。

如果安装了某附加功能的多个版本,则必须指定 version,或指定 'All' 以卸载所有版本。

matlab.addons.uninstall(identifier) 卸载具有指定标识符的附加功能。

示例

matlab.addons.uninstall(___,version) 还指定要卸载的附加功能的版本。请将此语法与上述语法中的任何参量结合使用。

示例

如果安装了多个版本,matlab.addons.uninstall(___,'All') 将卸载指定附加功能的所有已安装版本。

示例

全部折叠

假设您的系统上安装了一个名为 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"         true      "75442144-f751-4011-bf0e-32b6fb2f1433"

卸载 Random File Name Creator 工具箱。

matlab.addons.uninstall('Random File Name Creator');

假设您的系统上安装了名为 My Toolbox 的工具箱的版本 2.0 和版本 4.0。使用版本 4.0 后,您认为不再需要版本 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"

卸载 My Toolbox 版本 2.0,并确认它已卸载。

matlab.addons.uninstall('My Toolbox','2.0');
addons = matlab.addons.installedAddons
addons =

  1×4 table

             Name                   Version     Enabled                  Identifier              
    ___________________________    _________    _______    ______________________________________

    "My Toolbox_v4.0"              "4.0"         false     "6de8682e-9c3c-407e-bad7-aa103d738d08"

通过指定返回的标识符列表中的第一项来启用 My Toolbox 版本 4.0。然后,确认它已启用。

matlab.addons.enableAddon('My Toolbox_v4.0','4.0')
matlab.addons.isAddonEnabled('My Toolbox_v4.0','4.0')
ans =

  logical

   1

假设您的系统上安装了名为 My Toolbox 的工具箱的版本 2.0 和版本 4.0。您认为不再需要 My Toolbox,决定卸载该工具箱的所有版本。

获取已安装的附加功能列表。

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 的所有版本。

matlab.addons.uninstall(addons.Identifier(1),'All')

输入参数

全部折叠

要卸载的附加功能的名称,指定为字符向量或字符串。要确定附加功能的名称,请使用 matlab.addons.installedAddons 函数。

要卸载的附加功能的唯一标识符,指定为字符向量或字符串。要确定附加功能的唯一标识符,请使用 matlab.addons.installedAddons 函数。

要卸载的附加功能的版本,指定为字符向量或字符串。要确定附加功能的版本,请使用 matlab.addons.installedAddons 函数。

版本历史记录

在 R2018b 中推出