Install and ConfigureMATLABRuntime
Supported Platforms:Windows®, Linux®,macOS
MATLAB®Runtimecontains the libraries needed to run MATLAB applications on a target system without a licensed copy of MATLAB.
DownloadMATLABRuntimeInstaller
DownloadMATLAB Runtimeusing one of the following options:
Download theMATLAB Runtimeinstaller at the latest update level for the selected release from the website at//www.tianjin-qmedu.com/products/compiler/matlab-runtime.html. This option is best for end users who want to run deployed applications.
Use the MATLAB function
compiler.runtime.download
to download theMATLAB Runtimeinstaller matching the version and update level of MATLAB from where the command is executed. If the installer has already been downloaded to the machine, it returns the path to theMATLAB Runtimeinstaller. If the machine is offline, it returns a URL to theMATLAB Runtimeinstaller. This option is best for developers who want to create application installers that containMATLAB Runtime.
InstallMATLABRuntimeInteractively
To installMATLAB Runtime:
Extract the archive containing theMATLAB Runtimeinstaller.
Platform Steps Windows Unzip theMATLAB Runtimeinstaller.
Right-click the ZIP file
MATLAB_Runtime_R2022a_win64.zip
and selectExtract All.Linux Unzip theMATLAB Runtimeinstaller at the terminal using the
unzip
command.For example, if you are unzipping theR2022aMATLAB Runtimeinstaller, at the terminal, type:
unzip MATLAB_Runtime_R2022a_glnxa64.zip
macOS
Unzip theMATLAB Runtimeinstaller at the terminal using the
unzip
command.For example, if you are unzipping theR2022aMATLAB Runtimeinstaller, at the terminal, type:
unzip MATLAB_Runtime_R2022a_maci64.zip
Note
The release part of the installer file name (
_R2022a_
) changes from one release to the next.Start theMATLAB Runtimeinstaller.
Platform Steps Windows Double-click the file
setup.exe
from the extracted files to start the installer.Linux At the terminal, type:
sudo -H ./install
Note
You may need to allow the root user to access the running X server:
xhost + SI: localuser:根sudo /安装xhost - - hSI:localuser:root
macOS
At the terminal, type:
./install
Note
You may need to enter an administrator user name and password after you run
./install
.Note
If you are running theMATLAB Runtimeinstaller on a shared folder, be aware that other users of the share may need to alter their system configuration.
When theMATLAB Runtimeinstaller starts, it displays a dialog box. Read the information and then clickNextto proceed with the installation.
In theFolder Selectiondialog box, specify the folder in which you want to installMATLAB Runtime.
Note
You can have multiple versions ofMATLAB Runtimeon your computer, but only one installation for any particular version. If you already have an existing installation, theMATLAB Runtimeinstaller does not display theFolder Selectiondialog box because it overwrites the existing installation in the same folder.
Confirm your choices and clickNext.
TheMATLAB Runtimeinstaller starts copying files into the installation folder.
On Linux andmacOSplatforms, after copying files to your disk, theMATLAB Runtimeinstaller displays theProduct Configuration Notesdialog box. This dialog box contains information necessary for setting your path environment variables. Copy the path information from this dialog box, save it to a text file, and then clickNext. For information on setting environment variables, seeSet MATLAB Runtime Path for Deployment.
ClickFinishto exit the installer.
The defaultMATLAB Runtimeinstallation directory forR2022ais specified in the following table:
Operating System | MATLAB RuntimeInstallation Directory |
---|---|
Windows | C:\Program Files\MATLAB\MATLAB Runtime\v912 |
Linux | /usr/local/MATLAB/MATLAB_Runtime/v912 |
macOS | /Applications/MATLAB/MATLAB_Runtime/v912 |
InstallMATLABRuntimeNoninteractively
To installMATLAB Runtimewithout having to interact with the installer dialog boxes, use one of these noninteractive modes:
沉默的我nstaller runs as a background task and does not display any dialog boxes.
Automated — The installer displays the dialog boxes but does not wait for user interaction.
When run in silent or automated mode, theMATLAB Runtimeinstaller uses default values for installation options. You can override these values by usingMATLAB Runtimeinstaller command-line options or an installer control file.
Note
When running in silent or automated mode, the installer overwrites the installation location.
Run Installer in Silent Mode
To installMATLAB Runtimein silent mode:
Extract the contents of theMATLAB Runtimeinstaller archive to a temporary folder.
In your system command prompt, navigate to the folder where you extracted the installer.
Run theMATLAB Runtimeinstaller, specifying the
-mode silent
and-agreeToLicense yes
options on the command line.Note
On most platforms, the installer is located at the root of the folder into which the archive was extracted. On 64-bit Windows, the installer is located in the archive
bin
folder.Platform Command Windows setup -mode silent -agreeToLicense yes
Linux ./install -mode silent -agreeToLicense yes
macOS ./install -mode silent -agreeToLicense yes
Note
If you do not include the
-agreeToLicense yes
option, the installer does not installMATLAB Runtime.View a log of the installation.
On Windows systems, theMATLAB Runtimeinstaller creates a log file named
mathworks_
, whereusername
.logusername
is your Windows login name, in the location defined by yourTEMP
environment variable.On Linux andmacOSsystems, theMATLAB Runtimeinstaller displays the log information at the command prompt and also saves it to a file if you use the
-outputFile
option.
Customize a Noninteractive Installation
When run in one of the noninteractive modes, the installer uses the default values unless you specify otherwise. Like the MATLAB installer, theMATLAB Runtimeinstaller accepts a number of command-line options that modify the default installation properties.
Option | Description |
---|---|
-destinationFolder |
Specifies whereMATLAB Runtimeis installed. |
-outputFile |
Specifies where the installation log file is written. |
-tmpdir |
Specifies where temporary files are stored during installation. Caution The installer deletes everything inside the specified folder. |
-automatedModeTimeout |
Specifies how long, in milliseconds, that each dialog box is displayed when run in automatic mode. |
-inputFile |
Specifies an installer control file that contains your command-line options and values. Omit the dashes and put each option and value pair on a separate line. |
Note
The MATLAB installer archive includes an example installer control file calledinstaller_input.txt
. This file contains all of the options available for a full MATLAB installation. The options listed in this section are valid for theMATLAB Runtimeinstaller.
InstallMATLABRuntimewithout Administrator Rights
To installMATLAB Runtimeas a user without administrator rights on Windows:
Use theMATLAB Runtime安装程序在Windows机器上安装它you have administrator rights.
Copy the folder whereMATLAB Runtimewas installed to the machine without administrator rights. You can compress the folder into a zip file for distribution.
On the machine without administrator rights, add the
directory to the user’s
\runtime\arch
路径
environment variable. For more information, seeSet MATLAB Runtime Path for Deployment.
Install MultipleMATLABRuntimeVersions on Single Machine
MCRInstaller
supports the installation of multiple versions ofMATLAB Runtimeon a target machine. This capability allows applications compiled with different versions ofMATLAB Runtimeto execute side by side on the same machine.
If you do not want multipleMATLAB Runtimeversions on the target machine, you can remove the unwanted ones. On Windows, runAdd or Remove Programsfrom the Control Panel to remove a specific version. On Linux, manually delete the unwantedMATLAB Runtimedirectories. You can remove unwanted versions before or after installation of a more recent version ofMATLAB Runtimebecause versions can be installed or removed in any order.
Note
Installing multiple versions ofMATLAB Runtimeon the same machine is not supported onmacOS.
InstallMATLABandMATLABRuntimeon Same Machine
To test your deployed component on your development machine, you do not need an installation ofMATLAB Runtime. The MATLAB installation that you use to compile the component can act as aMATLAB Runtimereplacement.
You can, however, installMATLAB Runtimefor debugging purposes.
Modify Path
If you installMATLAB Runtimeon a machine that already has MATLAB on it, you must adjust the system library path according to your needs.
To run deployed MATLAB code againstMATLAB Runtimerather than MATLAB, ensure that your library path lists theMATLAB Runtimedirectories before any MATLAB directories.
For information on setting environment variables, seeSet MATLAB Runtime Path for Deployment.
UninstallMATLABRuntime
The method you use to uninstallMATLAB Runtimefrom your computer varies depending on your platform.
Windows
Start the uninstaller.
From the Windows Start menu, search for theAdd or Remove Programscontrol panel, and double-clickMATLAB Runtimein the list.
You can also start theMATLAB Runtimeuninstaller from the
\uninstall\bin\
folder, where<拱>
is yourMATLAB Runtimeinstallation folder and
is an architecture-specific folder, such as<拱>
win32
orwin64
.SelectMATLAB Runtimefrom the list of products in the Uninstall Products dialog box and clickNext.
ClickFinish.
Linux
Close all instances of MATLAB andMATLAB Runtime.
Enter this command at the Linux terminal:
rm -rf
Caution
Be careful when using the
rm
command, as deleted files cannot be recovered.
macOS
Close all instances of MATLAB andMATLAB Runtime.
Navigate to yourMATLAB Runtimeinstallation folder. For example, the installation folder might be named
MATLAB_Compiler_Runtime.app
in your Applications folder.Drag yourMATLAB Runtimeinstallation folder to the trash, and then selectEmpty Trashfrom the Finder menu.