Create Standalone Instrument Panel App by Using Application Compiler
This example shows how to create a standalone executable for a Simulink Real-Time instrument panel app using the Standalone Application Compiler (MATLAB Compiler) app.
Create an instrument panel app as an interface for a real-time application. Distribute this app as a standalone executable with an installer for users such as test engineers. For details on developing an App Designer instrument panel for a real-time application, see Create App Designer Instrument Panels by Using Simulink Real-Time Components.
When you share a standalone executable instrument panel and its associated real-time application, ensure recipients use a target computer configured with the same RTOS version and settings used during compilation. This workflow uses the Standalone Application Compiler tool to package the instrument panel app.
Note: The standalone executable is platform-specific. Its format depends on the operating system on which it was generated. Cross-platform deployment is not supported.
Create App Designer Instrument Panel
Create a Simulink Real-Time application for your model. For details, see Create and Run Real-Time Application from Simulink Model.
Open App Designer from MATLAB. Click MATLAB > File > New > App.
Add Simulink Real-Time components and other required components to the app.
Select an area outside the UI figure in the app.
In Component Browser, select Callbacks and add a StartupFcn callback.
Insert the function
slrealtime.includeAddonFilesForDeployedApp('all')in the StartupFcn code to include add-on files in the deployed app.Save the app.

When you use the Simulink Real-Time App Generator to create an instrument panel, the app generator automatically adds the slrealtime.includeAddonFilesForDeployedApp('all') function to include the required add-on files in the deployed app.
Package App by Using Standalone Application Compiler
Open the Standalone Application Compiler from the MATLAB Toolstrip. Click Apps > Application Deployment > Standalone Application Compiler.
Click New Project or open an existing project.
Add a Standalone Application from New Task > MATLAB Compiler.
In the Main File section, select the instrument panel app file.
In the Files Required for Standalone to Run, add the Simulink Real-Time application file used to create the app. Add optional files such as MATLAB scripts and data files.
Configure build options.
Customize Application Info such as Application Name, Author name, Summary, Description, etc.
Customize the Output Locations.
Configure the executable options such as Application Type, Input Type, Code Obfuscation, etc.
Configure Installer Details.
Choose package type.
Specify installer name.
Add notes, select an image for the installer, and specify the output location.
Build and package the application. This generates:
Installer - recommended for distribution
Executable - runs with MATLAB Runtime

Install and Run the Standalone Application
To install the instrument panel application, run the executable file from the
packagefolder.On Windows - MyAppInstaller.exe.
On Linux - MyAppInstaller.install.
When executed, the installer installs MATLAB Runtime and the instrument panel executable. Record the MATLAB Runtime path during installation. Use this path to run the standalone application on Linux.
Close MATLAB before testing the standalone executable.
Run the executable:
On Windows -
MyInstPanel_slrt_ex_osc.exeOn Linux -
./run_MyInstPanel_slrt_ex_osc.sh /usr/local/MATLAB/MATLAB_Runtime/v911
Use the instrument panel to connect to the target computer. Enter the target computer IP address (for example,
192.168.7.5) instead of the target computer name (for example,TargetPC1). Load the real-time application and start it. The instrument panel provides an interface to control the real-time application.
If you modify the real-time application or instrument panel app and repackage them, send only the updated EXE file from the package. Replace the existing EXE file in the user’s application folder. Do not resend the installer.
If your system uses firewall software such as Windows Defender Firewall and you configured exceptions for MATLAB® to allow Simulink® Real-Time™ communication with the target computer, configure exceptions for the compiled application as well. For details, see Troubleshoot Communication Failure Through Firewall (Windows).
See Also
Simulink Real-Time
Explorer | Instrument