If MATLAB is not launching properly, and you are not receiving any License Manager Errors, then you may be experiencing one of the following problems:
- Corrupt preferences
- Security software or other third party software interfering with MATLAB
- Issue with Java environment
- Installation directory
- Username has a non-ASCII character
- Single Sign-On (SSO) software interfering with MATLAB
- Clearing the TEMP directory
Problem #1: Corrupt preferences
One of the most common reasons MATLAB will fail to start is that something has corrupted the MATLAB preferences directory. You will need to reset your preferences to fix this.
- Browse to the following folder:
- AppData is a hidden folder, but you can use the shortcut %AppData% from Windows Search to jump right to the current user's AppData folder.
- Delete or rename the folder for your release of MATLAB, e.g R2020b. Do not remove any folder that ends with "_licenses".
- Restart MATLAB.
The preferences folder will be recreated automatically when you start MATLAB.
If you are using a roaming profile, please see the related article:
There will be some cases where the preferences directory is not being written to. In this case, you can set a MATLAB_PREFDIR environment variable to a temporary writable directory. Please see the article below for more details on how to set an environment variable.
Problem #2: Security software or other third party software interfering with MATLAB
Check any of your security software logs to see if it is preventing MATLAB to start properly. Programs such as the Symantec, McAfee, Kaspersky, AVAST, TrendMicro, BitDefender, and Webroot have all been known to prevent proper MATLAB startup.
If necessary, set exceptions so that MATLAB can start. You may need to consult your IT staff or your security software vendor for assistance creating exceptions.
In some cases, startup issues that are caused by common antivirus software could be diagnosed using the Windows Error Reporting log files. These log files are located in the following directories and can be read with a text editor like WordPad:
Check the folders within this directory (eg: ReportArchive) for files either created around the time that MATLAB failed to startup or contain the name MATLAB or JAVA.
Furthermore, Third-party software, such as AppSense, DeviceLock, and LastPass have been known to cause issues. Disabling these software's may resolve MATLAB startup issues.
Problem #3: Issue with Java environment
MATLAB has a command line environment in addition to the normal MATLAB Desktop environment. This environment is not dependent on Java and can be useful for troubleshooting MATLAB. To launch MATLAB with no desktop environment:
- Right click on the MATLAB shortcut and choose properties.
- Go to the end of the "Target" line, after MATLAB.exe, and add the flag -nodesktop. For example:
- "C:\Program Files\Matlab\R2020b\bin\matlab.exe" -nodesktop
- Press OK to save these changes.
- Try starting MATLAB again. If MATLAB starts, try running the command "desktop" to see if MATLAB will open in full mode.
- If this does not work, add the line -nojvm where -nodesktop previously existed and try to start MATLAB again.
- Finally, you can use the line -softwareopengl and try to start MATLAB again.
If MATLAB starts in either of these modes, this likely indicates a problem with your Java configuration. If MATLAB fails to start in either of these modes, more information may be obtained from the MATLAB crash dump files. To find these files, check your Temp folder:
The files will have names like:
Problem #4: Single Sign-On (SSO) software interfering with MATLAB
If the machine in question has SSO software installed, temporarily disable the SSO software then try to open MATLAB. If MATLAB launches, contact your IT department to allow/whitelist MATLAB from the SSO software, or disable SSO entirely.
Configure Oracle SSO to exclude MATLAB:
- Open the Oracle Enterprise Single Sign-On Administrative Console.
- Navigate to "Global Agent Settings" > "User Experience" > "Application Response".
- Locate the field that allows you to specify "Applications that hooks should ignore".
Problem #5: Installation directory
MATLAB may not start properly if it is not installed in its own contained folder or the folder contains non-ASCII characters. While non-default installation locations are fine, installing them into a directory with multiple non-MATLAB files in it can cause issues. For example, installing MATLAB directly into the C:\ drive will cause startup issues. Having MATLAB installed a folder with non-ASCII characters will also cause start up issues.
For this reason, it is recommended you install in either the default location or have the installation folder prefaced with MATLAB.
If you are getting error messages related to:
Attempt to execute SCRIPT as a function.
It is the result of installing MATLAB directly to the C: drive. MATLAB must be uninstalled and then reinstalled to the default path, C:\Program Files\MATLAB.
Problem #6: Clearing the TEMP directory
Deleting everything in your TEMP directory can resolve MATLAB startup issues. To access your TEMP directory, open Windows Explorer and type the following in the address bar.
You can safely delete everything in this folder as these are just temporary files.
Problem #7: Username has a non-ASCII character
If your username has a non-ASCII character in it, MATLAB will not boot up properly. This usually manifests as a Java error. Try setting the MATLAB_PREFDIR environment variable to a location that does not use any non-ascii characters. If this does not work, you will need to create another Windows username with ASCII characters to workaround this issue.
My problem is not listed here
If you are still unable to start MATLAB after these troubleshooting steps, please contact MathWorks support:
Please include any log files, error messages and screenshots pertaining to the problem with your help request.