Get license number or perform licensing task
license returns the license number for this MATLAB® product. The return value also can be
for a demonstration version of MATLAB,
'student', for a student version of
'unknown', if the license number cannot be
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.
1 even if the
license has expired or if a system administrator has excluded you
from using the product.
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
For details about your licenses such as expiration information, log into the MathWorks License Center.