This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

How To Run a Generated Executable Outside MATLAB

You can generate a standalone executable from the System objects and blocks in DSP System Toolbox™ which support code generation. This executable can run outside the MATLAB® and Simulink® environments.

To generate an executable from the System objects, you must have the MATLAB Coder™ installed. To generate an executable from the Simulink blocks, you must have the Simulink Coder installed in addition to the MATLAB Coder.

The executables generated from the following System objects and blocks rely on prebuilt dynamic library files (.dll files) included with MATLAB.

System Objects


You must include these .dll files when you run the corresponding executables outside the MATLAB and Simulink environments. To include the prebuilt .dll files, set your system environment using commands specific to your platform.

Macsetenv DYLD_LIBRARY_PATH "${DYLD_LIBRARY_PATH}:$MATLABROOT/bin/maci64" (csh/tcsh)


Linuxsetenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:$MATLABROOT/bin/glnxa64 (csh/tcsh)



set PATH=%PATH%;%MATLABROOT%\bin\win64

The path in these commands is valid only on systems that have MATLAB installed. If you run the standalone app on a machine with only MCR, and no MATLAB installed, replace $MATLABROOT/bin/.... with the path to the MCR.

To run the code generated from the above System objects and blocks on a machine does not have MCR or MATLAB installed, use the packNGo function. The packNGo function packages all relevant files in a compressed zip file so that you can relocate, unpack, and rebuild your project in another development environment with no MATLAB installed.

You can use the packNGo function at the command line or the Package option in the MATLAB Coder app. The files are packaged in a compressed file that you can relocate and unpack using a standard zip utility. For more details on how to pack the code generated from MATLAB code, see Package Code for Other Development Environments. For more details on how to pack the code generated from Simulink blocks, see the packNGo function.

More About

Was this topic helpful?