How do I force MATLAB to use a specific license file?

80 visualizzazioni (ultimi 30 giorni)

Risposta accettata

MathWorks Support Team
MathWorks Support Team il 13 Mar 2025
Modificato: MathWorks Support Team il 13 Mar 2025
For troubleshooting reasons, you may want to start MATLAB with only a specific license file. This can be accomplished by running MATLAB with a specific command that points to a single license file you want to use. To do so, follow these steps:
Windows
  1. Launch Windows Command Prompt or Powershell
  2. Type in "matlab -c path\to\license\file\license.lic". Replace "path\to\license\file\license.lic" with the full path to the license file you want to use. Make sure to include the name of the file too. If you're unsure where your license file is that you want to use, see the link at the bottom of this answer.
    NOTE: If a license_info.xml file exists in MATLABROOT/licenses, then use "matlab -licmode file -c path\to\license\file\license.lic"
  3. Press Enter on your keyboard to launch MATLAB with the single license file.
  4. If you have multiple releases of MATLAB installed and this command is launching a different release than you want, specify the full path to the matlab.exe from where you have MATLAB installed. For example, if you want to use release R2023b, matlab.exe's full path will likely be "C:\Program Files\MATLAB\R2023b\bin". This means the command you're using in Command Prompt or Powershell will look something like this: "C:\Program Files\MATLAB\R2023b\bin\matlab.exe -c C:\Users\james\AppData\Roaming\MathWorks\MATLAB\R2023b_licenses\license_james-computer_1234_5678_R2023b.lic"
    macOS
  1. Launch the Terminal application. You can find it in by searching for it with the magnifying glass in the top-right corner of your screen.
  2. Type in "/Applications/MATLAB_R2023b.app/bin/matlab -c path/to/license/file/license.lic". Replace "R2023b" with a different release of MATLAB if you are not using R2023b. Replace "path/to/license/file/license.lic" with the full path to the license file you want to use. Make sure to include the name of the file too. If you're unsure where your license file is that you want to use, see the link at the bottom of this answer.
  3. Press Return/Enter on your keyboard to launch MATLAB.
Linux
  1. Launch Terminal
  2. Type in "matlab -c path/to/license/file/license.lic". Replace "path/to/license/file/license.lic" with the full path to the license file you want to use. Make sure to include the name of the file too. If you're unsure where your license file is that you want to use, see the link at the bottom of this answer.
  3. Press Enter on your keyboard to launch MATLAB.
If you have multiple releases of MATLAB installed and this command is launching a different release than you want, specify the full path to the matlab from where you have MATLAB installed. For example, if you want to use release R2023b, matlab full path will likely be "/usr/local/MATLAB/R2023b/bin/matlab". This means the command you're using in Terminal will look something like this: "/usr/local/MATLAB/R2023b/bin/matlab -c /home/james/.matlab/R2023b_licenses/license_james-computer_1234_5678_R2023b.lic"
For more information on where the license files are typically stored, please refer to the following article:
Where can I find MATLAB license files?
 

Più risposte (0)

Categorie

Scopri di più su Manage Products in Help Center e File Exchange

Tag

Non è stata ancora inserito alcun tag.

Prodotti


Release

R2016a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by