Products & Services Solutions Academia Support User Community Company

Learn more about MATLAB   

license - Return license number or perform licensing task

Syntax

license
license('inuse')
S = license('inuse')
S = license('inuse', feature)
license('test',feature)
license('test',feature,toggle)
result = license('checkout',feature)

Description

license returns the license number for this MATLAB product. The return value is always a string but is not guaranteed to be a number. The following table lists text strings that license can return.

StringDescription

'demo'

MATLAB is a demonstration version

'student'

MATLAB is the student version

'unknown'

License number cannot be determined

license('inuse') returns a list of licenses checked out in the current MATLAB session. In the list, products are listed alphabetically by their license feature names, i.e., the text string used to identify products in the INCREMENT lines in a License File (license.dat). Note that the feature names returned in the list contain only lower-case characters.

S = license('inuse') returns an array of structures, where each structure represents a checked-out license. The structures contains two fields: feature and user. The feature field contains the license feature name. The user field contains the username of the person who has the license checked out.

S = license('inuse', feature) checks if the product specified by the text string feature is checked out in the current MATLAB session. If the product is checked out, the license function returns the product name and the username of the person who has it checked out in the structure S. If the product is not currently checked out, the fields in the structure are empty.

The feature string must be a license feature name, spelled exactly as it appears in the INCREMENT lines in a License File. For example, the string 'Identification_Toolbox' is the feature name for the System Identification Toolbox™. The feature string is not case-sensitive and must not exceed 27 characters.

license('test',feature) tests if a license exists for the product specified by the text string feature. The license command returns 1 if the license exists and 0 if the license does not exist. The feature string identifies a product, as described in the previous syntax.

license('test',feature,toggle) enables or disables testing of the product specified by the text string feature, depending on the value of toggle. The parameter toggle can have either of two values:

'enable'

The syntax license('test',feature) returns 1 if the product license exists and 0 if the product license does not exist.

'disable'

The syntax license('test',feature) always returns 0 (product license does not exist) for the specified product.

result = license('checkout',feature) checks out a license for the product identified by the text string feature. The license command returns 1 if it could check out a license for the product and 0 if it could not check out a license for the product.

Examples

Get the license number for this MATLAB.

license

Get a list of licenses currently being used. Note that the products appear in alphabetical order by their license feature name in the list returned.

license('inuse')

image_toolbox
map_toolbox
matlab

Get a list of licenses in use with information about who is using the license.

S = license('inuse');

S(1)

ans = 

    feature: 'image_toolbox'
       user: 'juser'

Determine if the license for MATLAB is currently in use.

S = license('inuse','MATLAB')

S = 

    feature: 'matlab'
       user: 'jsmith'

Determine if a license exists for the Mapping Toolbox™.

license('test','map_toolbox')

ans =

    1

Check out a license for the Control System Toolbox.

license('checkout','control_toolbox')

ans =

    1

Determine if the license for the Control System Toolbox is checked out.

license('inuse')

control_toolbox
image_toolbox
map_toolbox
matlab

See Also

isstudent

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS