MATLAB Answers

7

Why will MATLAB not start up properly on my Windows based system?

MATLAB will not start up on my Windows system, and I am not getting license manager errors.

Tags

No tags entered yet.

Products

9 Answers

Answer by MathWorks Support Team on 2 Aug 2019 at 4:00
Edited by MathWorks Support Team on 2 Aug 2019 at 20:34
 Accepted Answer

If you are having trouble starting MATLAB on Windows and you are not receiving license manager related errors, check for the following problems:
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.
1. Browse to the following folder:
C:\Users\<username>\AppData\Roaming\MathWorks\MATLAB
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.
2. Delete or rename the folder for your release of MATLAB, e.g R2016a. Do not remove any folder that ends with "_licenses".
3. 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. *
How do I set add or change environment variables?<https://www.mathworks.com/matlabcentral/answers/223482>
Problem #2: Security 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:
C:\Users\<username>\AppData\Local\Microsoft\Windows\WER\*
C:\ProgramData\Microsoft\Windows\WER\ReportArchive
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.
There has been a reported issue with McAfee recently with a new update to their Host Intrusion Prevention software (HIPS). They release a article about this issue, they have provided a workaround for the issue in this external link:
McAfee Knowledge Center
With McAfee HIPS, most commonly, it will manifest as a crash with no crash log but sometimes there will sometimes be a WER file that contains a McAfee line in it.
Problem #3: 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.
If you've identified the problem lies with your Single-Sign On software but cannot disable it or make an exception for MATLAB, contact MathWorks support:
Problem #4: 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:
1. Right click on the MATLAB shortcut and choose properties.
2. Go to the end of the "Target" line, after MATLAB.exe, and add the flag -nodesktop. For example:
"C:\Program Files\Matlab\R2016a\bin\matlab.exe" -nodesktop
Press OK to save these changes.
3. Try starting MATLAB again. If MATLAB starts, try running the command "desktop" to see if MATLAB will open in full mode.
4. If this does not work, add the line -nojvm where -nodesktop previously existed and try to start MATLAB again.
5. 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:
C:\Users\<username>\AppData\Local\Temp
The files will have names like:
matlab_crash*.XXXX
java.log.*
Solution #5: Installation folder created in the C: drive
If you are getting error messages related to:
Attempt to execute SCRIPT as a function.
C:\\toolbox\matlab\...
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: Possible Printer driver is corrupt
A corrupt printer driver can sometime cause this problem. To resolve this issue please re-install your printer drivers to the newest version.
If this still does not work please try these other workarounds:
1. Remove the printer from your list of devices in your control panel. The printer would be located in the Devices and Printers control panel for most Windows OS's.
2. End the print spooler/driver process inside of your Task manager and start MATLAB.
3. Change your default printer to another printer, or to the generic printer that Windows automatically creates under "Devices and Printers" within the Windows Control Panel.
Problem #7: Microsoft Visual Studio C++ Redistributable Conflict
Microsoft Visual Studio C++ Redistributables can conflict with each other if too many are installed. MATLAB R2006b and higher require variations of these redistributable to run. To install the 2005 and 2008 versions of these redistributables:
  1. Open the folder $MATLAB\bin\win64, where $MATLAB is the MATLAB installation folder.
  2. Launch vcredist_x64.exe from this location.
  3. Repeat step two using the vcredist_x64.exe in $MATLAB\bin\win64\vc90
  4. Try starting MATLAB by double clicking the matlab.exe in the bin folder.
If MATLAB starts, try MATLAB from the shortcut once again. If that fails, update the shortcut to point to the matlab.exe file in the $ARCH folder.
Lastly, the Microsoft Visual C++ 2010 Redistributable is not required for MATLAB but can conflict with the redistributables that are required by MATLAB. You may need to reinstall this redistributable to resolve the conflict:
If after reinstalling the redistributable you are still having issues, setting a MATLAB_PREFDIR driectory to the default preferences directory may resolve the issue. See Problem #1 for more details on setting this variable.
Solution #8: 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.
Problem #9: (For R2011b and earlier) More than 32 CPU cores
For releases prior to R2011b, there was a bug preventing start-up if the client's computer had 32 or more CPU cores.
Here's the Bug Report and patch:
Solution #10: 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.
%TEMP%
You can safely delete everything in this folder as these are just temporary files.
Solution #11: Username has a non-ASCII character
If your username has a non-ASCII character in it, MATLAB will not boot up properly. You will need to create another Windows username with ASCII characters to workaround this issue.
Solution #12: Disabling third-party software
Third-party software, such as AppSense, DeviceLock, and LastPass have been known to cause issues. Disabling these software's may resolve MATLAB startup issues.
Solution #13: (R2016a/b) Updating NVidia drivers
There is a rare, very specific startup issues regarding R2016x and NVIDIA drivers in Windows. MATLAB will work perfectly fine. Any subsequent startups will cause the process to fail to launch correctly.
To resolve the issue, upgrade to the latest NVIDIA drivers, as the nView software included with them causes the MATLAB startup threads to lock. Driver 361.80 is known to manifest the issue, while 373.06 and later are known to fix the problem.
Solution #14: (R14 and earlier) **Changing Windows theme
While this solution applies mainly to R14 and earlier, it is good practice to make sure you are on a default theme if you are experiencing issues with MATLAB. To install and use R14 on Windows 7, you will need to switch the Windows theme to Classic.
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.

  24 Comments

Thanks alot the first one worked for me!
Thanks the first answer worked for me

Sign in to comment.


Answer by J Cherian on 31 May 2017
Edited by J Cherian on 31 May 2017

If all the solutions listed above does not help, it could also be due to a seemingly unrelated issue after all.
In my case, this MATLAB issue occured on my Windows 7 computer after I switched it from a local WORKGROUP to join a corporate domain network. When this MATLAB issue occurred, I also observed that I cannot access the Printers anymore.
Strangely, the solution to both problems was to go the Services management console (type 'services.msc' in the windows run window) to stop the Spooler service and make it "Manual" instead of "Automatic". I had also cleared the preferences by deleting the relevant sub-folder under %Appdata%\Mathworks as per procedure given above.

  2 Comments

I must have had exactly the same problem, because stopping the spooler and switching to manual also solved my problem. Amazing!
My problem also (Spooler service). Many thanks for finding this and posting. So I wonder why this popped up all of a sudden?

Sign in to comment.


Answer by Anvinder Singh on 18 Feb 2017

none of this works. I have matlab 2016a on windows 7 home premium and AMD A10-8700. I have reinstalled it 4 times.

  1 Comment

You should contact Mathworks for free installation assistance.

Sign in to comment.


Answer by Magnus Lundin on 16 Nov 2018

Problem #1: Corrupt preferences
Actions suggested worked fine for me. Thanks!

  0 Comments

Sign in to comment.


Answer by Alessandro Maruccia on 4 Dec 2018

Problem solved! Thanks a lot!

  0 Comments

Sign in to comment.


Answer by muhammad faiz on 23 Apr 2019

problem solved by updating back the java (problem no 4)
Thanks a lot!

  0 Comments

Sign in to comment.


Answer by TJ Houck
on 24 Apr 2019

Worked! I only had to do step 1. Thanks!

  0 Comments

Sign in to comment.


Answer by PRACHI SHARMA on 5 Jun 2019

The solution given by Mathworks Support Team under the problem, Problem #1: Corrupt preferences, solved my problem of MATLAB 2019 window not maximizing.
Thanks a ton !

  0 Comments

Sign in to comment.


Answer by Marc Gauthier on 6 Jul 2019

Two items to add to the official answer's troubleshooting list:

  1 Comment

Sign in to comment.