How can I speed up my MATLAB startup time?

106 visualizzazioni (ultimi 30 giorni)
I recently upgraded MATLAB on my Windows machine. I find that MATLAB and Simulink take a long time to start up.  How can I speed up my startup time?

Risposta accettata

MathWorks Support Team
MathWorks Support Team il 17 Gen 2025
Modificato: MathWorks Support Team il 4 Feb 2025
Please see the steps below to improve your startup time:
1. As a diagnostic tool, you can use the "timing" run-time option to get more information about which specific portion of the startup is slow. To do this, you can run MATLAB from the Windows command prompt:
(a) Click on the Windows "Start" menu, type in "cmd", and press "Enter".
(b) Inside the command prompt, navigate to the "bin" folder inside the MATLAB R2020b directory: (Note that you may need to adjust this path for your system)
    cd C:\Program Files\MATLAB\R2020b\bin
    (c) Execute the following command inside the Windows command prompt window:
    matlab -timing
    This will start MATLAB and automatically record the time taken for each startup task. When the startup completes, you will see a log outputted inside the MATLAB Command window that summarizes the timing results. Note that this will also create a text log file noted at the top of the output.
    2. In the output of the timing results from Step (1) above, check if the "InitSunVM" task is taking a large amount of time to complete. If so, this might be related to the McAfee Virus Protection. If this is applicable to your system, there is a MATLAB Answers post that details a quick fix to resolve this issue:
    3. If the "LM Startup" task is taking a large amount of time, this could be due to licensing issues. To try and resolve this:
    (a) First locate your license file. See the page below for detailed instructions on doing so:
    (b) Start MATLAB from the command line and use the '-c' flag to point to your license file. For more information on using this flag, execute the following command in the MATLAB R2020a Command Window:
    >> web(fullfile(docroot, 'matlab/ref/matlabwindows.html'))
    NOTE: If you are using MATLAB R13 or prior, you will need to set the 'MLM_LICENSE_FILE' or 'LM_LICENSE_FILE' environment variable instead:
    Go to environment variables. If there is a variable called 'MLM_LICENSE_FILE' or 'LM_LICENSE_FILE' in system variable, replace the value of the variable by the path of the '.lic' file e.g 'network.lic' file. To get the path of 'network.lic' file execute the following command in MATLAB Command window:
    >> feature lmsearchpath
    4. Check if you have code being executed in your "startup.m" file. To access this, you can execute the command below inside the MATLAB Command Window:
    edit startup.m
    If the file is not empty, you can go through the code to determine if any function calls or operations inside may be slowing your startup procedure.
    5. In the MATLAB Toolstrip, click on "Home" and then on the "Preferences" button. Inside the "Preferences" window, select "MATLAB -> General" on the left-hand side. On the right-hand side, verify that "Enable toolbox path cache" is enabled (it should be enabled by default).
    6. Also inside the "Preferences" window, select "MATLAB -> General -> Source Control". If you do not use any form of source-control integration, you can select "None" on the right-hand side and then apply the changes. 
    Please use the below link to search for the required information in the current release:
      1 Commento
    Eric Delgado
    Eric Delgado il 19 Ott 2022
    @MathWorks Support Team, how to perform this analysis for the Matlab Runtime?!
    My desktop deployed apps are taking more than 20 seconds to open with my virus protection app disabled (Trend Micro Security Agent) and more than 40 seconds with Trend Micro enabled. I already put MATLABWindow.exe and the folder of Matlab Runtime in the white list of Trend Micro, but the issue remains...

    Accedi per commentare.

    Più risposte (0)

    Categorie

    Scopri di più su Startup and Shutdown in Help Center e File Exchange

    Tag

    Non è stata ancora inserito alcun tag.

    Prodotti


    Release

    R2015b

    Community Treasure Hunt

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

    Start Hunting!

    Translated by