Why does MATLAB crash on startup on Windows when logging into a machine with a roaming profile or profile redirection?

341 views (last 30 days)
When launching MATLAB from a machine that uses a roaming profile, MATLAB crashes on startup. The program either quits immediately or hangs at the splash screen.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 30 May 2012
It is believed that this issue is due to domain permissions on the profile directory. Some users have reported that regenerating the profile resolves this issue. As a workaround you can try the following:
To resolve this issue you can redirect the MATLAB preferences directory. To do so, you will need to set an environment variable, MATLAB_PREFDIR to a different location. MATLAB_PREFDIR can be set with the following steps:
1) Go to your Start menu to Control Panel.
2) Under Control Panel, select System.
3) In the System Properties window, select the Advanced tab.
4) On the Advanced Tab, click the button for Environment variables
5) If this is a shared machine, click the "New" button under System variables. If the machine is not shared, click the "New" button under User variables.
6) In the variable field, enter "MATLAB_PREFDIR" (without the quotes)
7) In the variable value field, enter the path that you wish to store the preferences. EX: C:\MATLAB_preferences
8) Press OK three times to set the variable
Once set, the preferences will be redirected to the new location and you should be able to start MATLAB. If you are still having an issue starting MATLAB, contact Installation support here:

Sign in to comment.

More Answers (1)

Robert Spring
Robert Spring on 8 Mar 2021
MATLAB will not start. I was using MATLAB R2020a yesterday and it worked fine. Today it will not start. I installed R02.0b and it will not start. I created the environment variable MATLAB_PREFDIR and tried again. MATLAB created the folder but still does not start.
Robert Spring
Robert Spring on 17 Mar 2021
I solved the problem by un-installing all versions of MATLAB including deleting all preferences. A simple un-install did not fix the problem. Therefore, the issue was probably related to the existing preferences. Thank you.

Sign in to comment.


No tags entered yet.


Community Treasure Hunt

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

Start Hunting!