It is important to download the MATLAB Runtime installer that matches your MATLAB release and update level according to the "version" MATLAB command (for example, R2024a Update 6). Consider one of the following options:
Option 1: Use "compiler.runtime.download" for online installations
>> compiler.runtime.download
This option is recommended because it will download the exact MATLAB Runtime installer that matches your MATLAB release and update level. The ZIP file will be downloaded directly from the MathWorks website to your system's TEMP folder. Due to the file size of the monolithic installer (typically 2-5GB), this may take some time. Once the download is complete, MATLAB will display the exact location of the installer, for example:
MATLAB Runtime installer has been downloaded to:
"C:\Users\username\AppData\Local\Temp\username\MCRInstaller24.1\MATLAB_Runtime_R2024a_Update_6_win64.zip"
The MATLAB Compiler preferences will also be updated to reflect this location.
Note: The TEMP folder is intended for temporary files and may be cleared by the system. We recommend moving the installer to a permanent location to prevent accidental loss. To ensure the Application Compiler can find the installer in its new location, follow these steps:
- Open MATLAB.
- Go to the HOME tab in the upper left corner.
- Click on "Preferences" (gear icon).
- In the left pane, select "MATLAB Compiler".
- In the right pane, under "MATLAB Runtime Installer Location", enter the full path to the MATLAB Runtime installer file as shown in the screenshot below:
Option 2: Direct URL download
If your machine is offline, or the download via MATLAB fails, the "compiler.runtime.download" function will display a message with the direct URL to download the appropriate MATLAB Runtime installer for your MATLAB release and update level (since R2020a). You can also use the following (undocumented) command to obtain the correct URL:
>> com.mathworks.toolbox.compiler.MatlabRuntimeUtils.getMCRInstallerDownloadURL
After you manually download the installer and copy the ZIP onto the MATLAB machine, update the MATLAB Compiler preference to point to this installer as shown in the instructions above. You do NOT need to run the installer.
Option 3: Use the MATLAB Runtime download page
By downloading the MATLAB Runtime installer from the table on our MATLAB Runtime Download Page, you will receive the installer for the latest update of the selected major release:
To package this runtime installer with your application, you need to ensure your MATLAB installation uses the latest update level as well using these instructions. If you cannot update MATLAB to the latest update level, and don't currently have access to MATLAB to obtain the correct URL for the matching MATLAB Runtime installer, see the following MATLAB Answer on how to construct the URL manually:
For more information on update level compatibility with MATLAB Compiler, see: