MATLAB: Where does MATLAB look for licenses

license fileMATLAB

I have a license file that I need to add to MATLAB. Where does MATLAB look for license files?

Best Answer

As of R2008a, MATLAB will search for licenses in the following order:
1. Any license files or license servers specified with the -c startup flag override all other entries on the license search path
2. MATLAB will check any license files or servers in the environment variables MLM_LICENSE_FILE or LM_LICENSE_FILE
3. MATLAB will check against the registry keys:
HKEY_LOCAL_MACHINE\Software\FLEXlm License Manager\MLM_LICENSE_FILE
HKEY_LOCAL_MACHINE\Software\FLEXlm License Manager\LM_LICENSE_FILE
Or on Unix, it will check for ~/.flexlmrc.
4. MATLAB will check in the user's profile:
MATLAB will first search the $APPDATA\MathWorks\MATLAB\$VER_licenses folder (for Windows), and ~/.matlab/$VER_licenses (for Mac/Unix/Linux). Where:
$APPDATA is the Windows User Application Data location (obtained from navigating to %APPDATA% in Explorer) $VER is the folder for the MATLAB version (ex: R2008a)
For example, this will be:
C:\Documents and Settings\user\Application Data\MathWorks\MATLAB\R2008a_licenses\
or
/home/user/.matlab/R2008a_licenses/
MATLAB will first look for a license.dat file, then search for files with the extension .lic in alphabetical order.
5. Lastly, MATLAB will check in the "licenses" folder under the MATLAB installation. For example:
C:\Program Files\MATLAB\R2008b\licenses (Windows)
/Applications/MATLAB_R2008b.app/licenses (Mac)
/usr/local/MATLAB/R2008b/licenses (Linux)
MATLAB will first look for a license.dat file, then search for files with the extension .lic in alphabetical order.