While it is not necessary to perform a "clean" installation of MATLAB, remnants from a previous installation of MATLAB may cause problems with a new installation of MATLAB. To perform a clean installation of MATLAB:
- Uninstall MATLAB
- Manually delete the installation folder (Windows Only)
- Delete the user preferences folder
- Remove the MathWorks Installer
- Re-install (without interference from third-party apps)
1. Uninstall MATLAB
Uninstall MATLAB. Detailed operating system-specific instructions can be found here:
Delete any desktop shortcuts for MATLAB.
2. Manually delete the installation folder (Windows Only)
After this is done, open a File Explorer window and navigate to the MATLAB root folder. By default, on Windows, this folder is located at:
Delete the folder corresponding to the MATLAB release you are removing, e.g., "R2020b." You may need administrator permission to delete this folder.
Note: If you are unable to locate MATLAB in these locations, please check with your system administrator to find the MATLAB installation folder.
3. Delete the user preferences folder
Next, navigate to the preferences folder (prefdir). The default location is listed below: Windows:
In a File Explorer window, type the following into the address bar and then press Enter:
This will take you to the "Roaming" folder in the user account you are currently logged in to. From here, open "MathWorks" and then "MATLAB".
macOS:
- Open the Finder (the blue face on the dock).
- In Finder, click the “Go” menu and select “Go to Folder”.
- Go to this folder: ~/Library/Application Support/MathWorks/MATLAB
- For R2016a and earlier: ~/.matlab
Linux/UNIX:
- Open the Terminal Application (usually found in Applications or Utilities).
- In the terminal window and run the following commands:
Steps to follow:
Delete the folder corresponding to the MATLAB release you are removing, e.g. "R2020b." There may also be a licenses folder for the release in question, e.g., "R2020b_ licenses." Remove this folder as well.
Note: if you are an administrator performing this action for another user, you will need to do it from that user's folder, not the administrator's.
4. Remove the MathWorks Installer
Finally, delete any MathWorks Installer you previously downloaded from your Downloads folder. This folder can change depending on your internet browser settings, but the default location is listed below:
Windows:
macOS:
- Open the Finder (the blue face on the dock).
- In Finder, click the “Go” menu and select Downloads.
Linux/UNIX:
Steps to follow:
There will be a folder and executable to delete for each MATLAB release. Please delete both and then re-download the installer from the MathWorks website.
Examples for the files on Windows are:
- matlab_R20XXy_win64.exe
- _temp_matlab_R20XXy_win64
Note: XXy is a placeholder for your specific release of MATLAB.
5. Re-install (without interference from third-party apps)
If you still face issues, please note that third-party apps like Antivirus programs can sometimes interfere with the installation process. You have several options to work around this:
- Work with your internal IT to temporarily disable security software
- Install on a different network or machine
- Reboot the machine in Safe Mode to prevent third-party-apps from starting up