I believe this can be done in the following 2 ways :
- Using the environment variable MLM_LICENSE_FILE (or LM_LICENSE_FILE):
- Using the "-c" startup flag for MATLAB
Using the environment variable MLM_LICENSE_FILE (or LM_LICENSE_FILE):
By setting the environment variable MLM_LICENSE_FILE (or LM_LICENSE_FILE), you can insert a new license search path for MATLAB. The variable value will be searched first, but this will not override the original search path. The value for this variable can either be a path to a license file, or it can be used in the port@host notation. For example, to have MATLAB check against the server "license1" on port 27000, you would set the variable value to be: 27000@license1.
You can also manually specify the location of the license file with the -c option to the MATLAB startup script. This can be achieved by editing the "Target" field in the MATLAB shortcut.
For example:
- Right click on the MATLAB shortcut and choose "Properties"
- In the "Target" field, add -c and the path to the license file after the end quotation mark:
"C:\Program Files\MATLAB\R2009b\bin\matlab.exe" -c "C:\Program Files\MATLAB\R2009b\licenses\test.lic"
Using the -c flag will override any default license search paths unlike the MLM_LICENSE_FILE variable.
To find the default locations for MATLAB license files, see the related solution: