Get license status, test existence of product license, or check out feature license
Use the license function to return the license number in use, list the licenses checked out in the current session, list licenses checked out by user, determine if a particular product on the license is checked out, and check out a specific product on the license. To perform license management tasks, including how to renew or deactivate a license, see Manage Your Licenses.
license returns the license number for this MATLAB® product. The return value may also be a non-number, for example,
'demo' for a demonstration version of MATLAB, or
'student', for a student version of
array of structures indicating checked-out licenses and the user name of each
person who has a license checked out.
S = license('inuse')
Display a list of licenses currently being used.
license displays a list of products in alphabetical
order by the license feature name for your configuration.
image_toolbox map_toolbox matlab
Get a list of licenses in use with information about each
license returns a structure array.
S = license('inuse');
View the first element of
ans = feature: 'image_toolbox' user: 'juser'
Determine if the license for MATLAB is in use. If the license is in use, then
a structure array with nonempty fields.
S = license('inuse','MATLAB')
S = feature: 'matlab' user: 'jsmith'
Determine if a license exists for Mapping Toolbox™. If a license exists, then
status = license('test','MAP_Toolbox')
status = 1
Check out a license for Control System Toolbox™. The
status output is
errmsg output is empty if the checkout is
[status,errmsg] = license('checkout','Control_Toolbox')
status = 1 errmsg = ''
feature— License feature name
License feature name, specified as a character vector. Values of
feature are not case-sensitive. The
INCREMENT lines in a license file indicate the valid
features. To locate your license file, see Where are the license files for MATLAB located?
toggle— Ability to test product license
Ability to test the existence of a product license, specified as either
then the syntax,
1 when the product license exists and
0 when the product license does not
then the syntax,
0 (product license does not
exist) for the specified product.
Disabling a test for a particular product can affect other tests for
the existence of the license, not just tests performed by the
S— Checked out products
Checked out products, returned as an array of structures, where each structure represents a checked-out license. The structures contain two fields:
feature — license feature
user — user name of the person who
has the license checked out
If the fields are empty, then the product is not currently checked out.
status— Test or checkout status
Test or checkout status, returned as
When testing for the existence of a license,
indicates that the license exists, and
indicates that the license does not exist.
The existence of a license does not necessarily mean that the license can be checked out or that the product is installed. If all the keys of a product are in use, then the test will still return 1, but a real checkout will fail.
When checking out a license,
1 indicates that
the checkout is successful, and
0 indicates that
license function could not check out a
errmsg— Error message
Error message for unsuccessful license checkout, returned as a character
vector. If the checkout is successful, then
Error messages usually indicate how you can resolve the issue. For example:
License checkout failed. License Manager Error -5 Cannot find a license for FEATURENAME. Troubleshoot this issue by visiting: https://www.mathworks.com/support/lme/R2021b/5
The license checkout error you get can depend on what type of license you have.
Sign in to your MathWorks® Account for details about all licenses linked to your account, such as license type, product use, and expiration information.
To perform license management tasks, including how to renew or deactivate a license, see Manage Your Licenses.