Main Content


Query or modify version of toolbox



currentVersion = matlab.addons.toolbox.toolboxVersion(toolboxFile) queries toolboxFile for the current version number. You do not need to install the toolbox to query the version number.


previousVersion = matlab.addons.toolbox.toolboxVersion(toolboxFile,newVersion) sets the toolbox version number to newVersion and returns the previous version number.


collapse all

Assume that you have the myToolbox.mltbx toolbox file on your MATLAB® search path. Query the version number.

toolboxFile = 'myToolbox.mltbx';
currentVersion = matlab.addons.toolbox.toolboxVersion(toolboxFile) 
currentVersion =


Assume that you have the myToolbox.prj toolbox project file on your MATLAB search path. Update the myToolbox version number to 2.0.

toolboxFile = 'myToolbox.prj';
newVersion = '2.0';
previousVersion = matlab.addons.toolbox.toolboxVersion(toolboxFile,newVersion)
previousVersion =


Verify that the version number is now 2.0.

currentVersion = matlab.addons.toolbox.toolboxVersion(toolboxFile)
currentVersion =


The version number is updated for the toolbox project file, but not for the MATLAB toolbox file (.mltbx).

ans =


Repackage the toolbox to update the .mltbx file. For more information, see matlab.addons.toolbox.packageToolbox.

Input Arguments

collapse all

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

If you are only querying the toolbox version, toolboxFile can be a toolbox project file (.prj) or a MATLAB toolbox file (.mltbx).

If you are setting the toolbox version, toolboxFile must be a toolbox project file (.prj).

Example: toolboxFile = 'myToolbox.mltbx'

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

New toolbox version number, specified as a character vector or string scalar. Enter the toolbox version number in the Major.Minor.Bug.Build format. The Bug and Build segments are optional. Each segment of the version number is an integer.

Example: newVersion = "2.0"

Example: newVersion = ''


You can query the version number of your toolbox from the Add-On Manager UI. For more information, see Get and Manage Add-Ons.

You can update the version number of your toolbox from the Package a Toolbox UI. For more information, see Create and Share Toolboxes.

Version History

Introduced in R2016a