Documentation

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

Blocks

  • Audio Device Writer

  • Burg Method (when the FFT length is not a power of two)

  • From Multimedia File

  • To Multimedia File

  • FFT

    • When FFT implementation is set to FFTW.

    • When you clear the Inherit FFT length from input dimensions check box, and set FFT length to a value that is not a power of two.

  • IFFT

    • When FFT implementation is set to FFTW.

    • When you clear the Inherit FFT length from input dimensions check box, and set FFT length to a value that is not a power of two.

  • Inverse Short-Time FFT (when the input length is not a power of two)

  • Magnitude FFT

    • When FFT implementation is set to FFTW.

    • When you clear the Inherit FFT length from input dimensions check box, and set FFT length to a value that is not a power of two.

  • Periodogram

    • When FFT implementation is set to FFTW.

    • When you clear the Inherit FFT length from input dimensions check box, and set FFT length to a value that is not a power of two.

  • Short-Time FFT (when the FFT length is not a power of two)

  • UDP Receive

  • UDP Send

To run the corresponding executable outside the MATLAB and Simulink environments, for example Windows command prompt on a Windows machine, you must include these .dll files. To include these .dll files, set your system environment by running the commands below.

PlatformCommand
Mac

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

export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$MATLABROOT/bin/maci64 (Bash)

Linux

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

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MATLABROOT/bin/glnxa64 (Bash)

Windows

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

To run these commands, the machine must have either MATLAB or MCR installed. The commands in the table apply when the computer has 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 the relevant files including the prebuilt .dll files in a compressed zip file so that you can relocate, unpack, and rebuild your project in another development environment where MATLAB is not 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 Relocate Code Generated from MATLAB Code to Another Development Environment. For more details on how to pack the code generated from Simulink blocks, see Relocate Code Generated from a Simulink Model to Another Development Environment.

Related Topics

Was this topic helpful?