主要内容

Resolve Slow Startup

Issue

Configuration issues and other factors can delay the startup of MATLAB® and Simulink®. Use these solutions to tune the startup time.

Possible Solutions

You can gather information about MATLAB startup processes by starting MATLAB with the -timing option.

matlab -timing

In the Command Window, MATLAB displays the startup timing log, which shows the time taken for each startup task.

Follow CPU and RAM Requirements

To get the best startup performance experience, follow the recommended system requirements for CPU and RAM listed at MATLAB System Requirements. The requirements vary depending on your operating system.

Invalid Path to License

Licensing issues can occur when MATLAB license search path points to a license server or license file that no longer exists. Remove or update any out-of-date license server names or license files that are on this path. For details about the search path, see MATLAB License Search Path.

Before R2026a: If the MATLAB installation is experiencing a licensing issue, MATLAB might open with an "Initializing" or "Busy" message that persists for an extended period of time.

Corrupted MathWorksServiceHost Installation

If the Session Initialize task shown in your startup timing log takes more than 30 seconds, you might have a corrupted MathWorks Service Host installation. If you encounter startup issues, uninstalling and reinstalling the MathWorks Service Host might resolve these issues. For more information, see the MATLAB Answers™ article How do I uninstall and reinstall the MathWorks Service Host?

Enable Toolbox Path Cache

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.

Restore Settings Folder

A corrupt settings folder can prevent MATLAB from starting properly. To restore the default settings for a given release of MATLAB, rename all of the files in the corresponding settings folder. When you restart MATLAB, MATLAB sets all settings to their default values.

  • Use the prefdir command to determine the full path of the settings folder.

    For example, to restore the default settings for R2025a, type prefdir in the Command Window to determine the location of the settings folder.

    prefdir
    ans =
        'C:\Users\username\AppData\Roaming\MathWorks\MATLAB\R2025a'

  • Close MATLAB.

  • Rename all of the files in the folder C:\Users\username\AppData\Roaming\MathWorks\MATLAB\R2025a.

    One file to consider not restoring is history.m. For more information, see Modify Command History Settings.

  • Start MATLAB again. The settings are set to their default values.

Optimize Power Settings

To support the optimal startup experience, set the power mode of your computer to Balanced or High Performance.

Reduce User Code Run at Startup

If you customize MATLAB startup, the code you execute might significantly increase startup time. Review and remove any unnecessary code in these locations:

  • startup file — At startup, MATLAB executes the user-specified commands in this file. For more information, see startup.

  • MATLAB startup command with the -r option — At startup, MATLAB executes the statement specified after the -r option. For example, this statement runs myscript at startup.

    matlab -r "myscript"
  • matlabrc.m file — At startup, MATLAB executes the commands in the matlabrc.m file, which is reserved for use by MathWorks® and by system administrators on multiuser systems. The file is in the matlabroot/toolbox/local folder.

Uninstall Unused Products

MATLAB startup time increases as the number of installed products increases because it requires additional time to load and initialize the set of libraries and resources associated with each product. To minimize start time, install only the set of products you need. You can review your installed products using this command.

ver

For information about uninstalling a product, see Uninstall MATLAB Toolboxes and Support Packages.

Access Files on Local Disk

MATLAB startup time is slower when the software is installed on or loads files from a network location. The slower startup time is due to the increased latency and reduced data transfer speeds on a network, compared with accessing files on a local disk. You can reduce startup time by relocating the MATLAB program and associated files to a local drive. Additionally, installing MATLAB on a solid state drive (SSD) offers better MATLAB startup time, compared with the traditional spinning disk.

Reboot Program

When you start MATLAB and Simulink after a period of inactivity or shutdown, the software loads all of the necessary data and resources from disk into memory, resulting in longer startup times. In contrast, if you start MATLAB while some of its data is still cached in RAM from a recent session, the software has faster access to the data, which can reduce the load time. The primary difference in time is due to the speed of accessing cached data in memory, rather than loading it fresh from disk storage.

Examine JAR Files

If you have a product that uses Java® archive (JAR) files, call javaclasspath and check if the Java class path file contains any network file paths. Moving files from the network to a local folder reduces the startup time. Also, some antivirus software might impact the access to network JAR files. For more information, see Antivirus and EDR Software. Work with your local IT department to resolve these issues.

Antivirus and EDR Software

Antivirus software and EDR (Endpoint Detection and Response) software can affect startup time. If you notice your antivirus process uses a large amount of CPU or memory resources while MATLAB starts up, work with your local IT department to resolve the issue.

Network Issues

Misconfigured VPNs or hosts can interfere with the communication between the desktop and MATLAB processes. You might have a network issue if:

See Also

Functions

Topics