About MATLAB Runtime
MATLAB® Runtime (MCR) is a freely-available set of shared libraries, MATLAB code, and other files that enables the execution of MATLAB files on computers without an installed version of MATLAB. Applications that use artifacts built with MATLAB Compiler™ or MATLAB Compiler SDK™ require access to a matching version of MATLAB Runtime at the same update level or newer to run.
End users of compiled artifacts without access to MATLAB must install MATLAB Runtime. For details, see Download and Install MATLAB Runtime. For information on using a network installation of MATLAB Runtime, see Deploy Applications and MATLAB Runtime on Network Drives.
The installers generated by the compiler apps or functions such as compiler.package.installer
may include the
MATLAB Runtime installer.
After you install MATLAB Runtime, you may need to add the directories to the system library path depending on your operating system and shell environment. For details, see Set MATLAB Runtime Path for Deployment.
Differences Between MATLAB Runtime and MATLAB
The MATLAB Runtime differs from MATLAB in several important ways:
MATLAB Runtime is freely available to download on the MathWorks® website. MATLAB requires an active license to use.
In MATLAB Runtime, MATLAB files are encrypted and immutable.
MATLAB has a desktop graphical interface. MATLAB Runtime has all the MATLAB functionality without the graphical interface.
MATLAB Runtime is version-specific. You must run your applications with the version of MATLAB Runtime associated with the version of MATLAB Compiler with which it was created. For example, if you compiled an application using release R2023a of MATLAB, end users must install version R2023a at the same update level or later of MATLAB Runtime. Use
mcrversion
to return the version number of MATLAB Runtime.The MATLAB paths in a MATLAB Runtime instance are fixed and cannot be changed. To change them, you must first customize them within MATLAB.
Size and Performance Considerations for MATLAB Runtime
MATLAB Compiler SDK was designed to work with a large range of applications that use the MATLAB programming language. Because of this, run-time libraries are large.
Since MATLAB Runtime provides full support for the MATLAB language, including the Java® programming language, starting a compiled application takes approximately the same amount of time as starting MATLAB. The amount of resources consumed by MATLAB Runtime is necessary in order to retain the power and functionality of a full version of MATLAB.
Calls into MATLAB Runtime are serialized, so calls into MATLAB Runtime are thread-safe. This can impact performance.
Reduce MATLAB Runtime Size
Since R2024b
Starting in R2024b, you can reduce the size of a MATLAB Runtime installation. Create a custom MATLAB Runtime installer with a minimal size footprint using the compiler.runtime.customInstaller
function.
Additionally, GPU libraries are no longer required dependencies for MATLAB Runtime. Packaged MATLAB code that does not display graphical output can be run using a
MATLAB Runtime installation without GPU libraries. You can use MATLAB Runtime without GPU support by using the compiler.runtime.customInstaller
function or the MATLAB Runtime
Docker® image hosted on the MathWorks
Docker repository. For more information, see MATLAB Runtime Container.
See Also
mcrversion
| compiler.runtime.download