Main Content

Resolve Slow Startup

R2026b

Issue

MATLAB® might take a long time to start or remain in the Initializing or Busy state. Slow startup can occur for several reasons, including licensing issues, corrupted preferences, network delays, antivirus interference, or system configuration problems. Use these steps to diagnose and resolve the issue.

Possible Solutions

Configure System Setup

To get the best startup performance experience, review these hardware and software recommendations.

  • Verify that your system meets the CPU and RAM requirements listed in MATLAB System Requirements.

  • If you recently updated your operating system, ensure the update completed successfully. Install any pending updates and restart your computer.

  • Install MATLAB on a solid state drive (SSD), which provides faster startup time than a hard disk or network drive.

  • Avoid installing MATLAB on or loading files from network locations. Move the installation and related files to a local disk to improve performance.

  • Windows® only: set your system power mode to Balanced or High Performance.

Restart MATLAB Settings and Caches

  • A corrupted settings folder or path cache can prevent MATLAB from starting properly. For information about restoring default settings, see this MATLAB Answers™ article How do I regenerate my MATLAB preferences?

  • To determine whether the path cache is disabled, start MATLAB at the system prompt with the timing option:

    matlab -timing

    In the timing log, if the cachepath task is missing, run:

    rehash toolboxcache

    For more information, see Toolbox Path Caching in MATLAB.

  • Windows only: Restore the AppDatasettings folder:

    C:\Users\<username>\AppData\Local\MathWorks\MATLAB\<R20XXy>
  • Ensure MATLAB is not attempting to access files on slow network drives. Use the path command to confirm that all directories are local. You can remove network drives to see if there is any improvement.

  • Avoid adding a large number of files to the MATLAB path.

  • If you use Java® archive (JAR) files, run javaclasspath and check for any JARs located on a network drive. Moving them to a local folder improves startup time.

Disabling a toolbox path cache or having a corrupted path cache slows the MATLAB startup time. To see if the path cache is disabled, check the matlabpath task in the startup timing log. If the time is greater than 10 seconds and the cachepath task is missing, follow the instructions in Toolbox Path Caching in MATLAB to enable and update the cache.

Configure Networking and Security Software

Antivirus software and Endpoint Detection and Response (EDR) software might cause delays during startup. If your antivirus software consumes significant CPU, network bandwidth, or memory during MATLAB startup, ask your local IT department for assistance. One option for IT to consider is disable active scanning for MATLAB directories.

Network issues, including misconfigured VPNs or host files, can also interfere with communication between MATLAB processes.

Reinstall MathWorks Service Host

If you see the error:

Unable to access services required to run MATLAB (error 5201)

you might have a corrupted MathWorks Service Host installation. Uninstalling and reinstalling the Service Host might resolve this issue. For instructions, see the MATLAB Answers article How do I uninstall and reinstall the MathWorks Service Host?

Optimize Startup Performance

Custom startup code can significantly increase the MATLAB startup time. Review and remove any unnecessary code from:

  • The startup file.

  • The MATLAB startup command using the -r option:

    matlab -r "myscript"
  • The matlabrc.m file used by MathWorks® and system administrators.

MATLAB startup time also increases with the number of installed products, as each one requires libraries and resources to load. To improve startup time:

See Also

Functions

Topics