MATLAB Answers

How can I create an executable from my Simulink model to send to someone who does not have MATLAB?

216 views (last 30 days)
I want to be able to create an executable for my Simulink model to send to someone who does not have MATLAB or Simulink installed on their computer.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 29 Jul 2020
Edited: MathWorks Support Team on 29 Jul 2020
Depending on what you are looking for, there are two approaches you may consider:
First, Simulink Compiler enables you to share Simulink simulations as standalone executables starting in R2020a. If you require variable-step solvers, or need to deploy the simulation including graphics, an App, or other Simulink semantics not supported for code generation, you should use Simulink Compiler.
Simulink Compiler enables you to build simulation executables by packaging the compiled Simulink model and the MATLAB code to set up, run, and analyze a simulation. With Simulink Compiler, the standalone executables can be complete simulation apps that use MATLAB graphics and UIs designed with MATLAB App Designer. End users do not need full MATLAB or Simulink installations, they only need to install MATLAB Runtime to run and use the compiled simulation.
For an illustration of compiling a standalone simulation and including an App built with App Designer, refer to the following example:
To install MATLAB Runtime, direct end users to the following website:
Secondly, Simulink Coder generates optimized, portable, and customizable code from Simulink models. If you need to create a stand-alone executable for a model just in order to run the simulation, you can use Simulink Coder to build your model with the generic real-time (GRT) target.
The generic real-time (GRT) target provides an environment for simulating models using a fixed-step solver in single or multitasking mode. An executable generated with the GRT target runs your model as a stand-alone program on your workstation. The executable will run as fast as possible, and therefore is a non real-time simulation.
By default, executables generated with the GRT target will support only fixed-step solvers, and only Simulink blocks and features supported for code generation are supported under this workflow. With this in mind, Simulink Compiler offers enhanced functionality and is typically better-suited to sharing and deploying applications for users without MATLAB or Simulink.
The following documentation page describes how to build an executable from a Simulink model using the 'StandaloneCoderTarget' option with "slbuild":
For more information on the differences between Simulink Compiler and Simulink Coder, refer to the following documentation page:


Show 2 older comments
Marian Kersting
Marian Kersting on 11 Apr 2018
With MatlabVersion 2018a Mathworks has added a "Real-Time Pacer" in Simulink. This option can slow down a Simulation to Real-Time. (I don't know yet wether it supports Code Generation but I am about to try)

Sign in to comment.

More Answers (2)

fayçal ahmed zaid
fayçal ahmed zaid on 11 Aug 2016
Hi, I have the same problem, i'd like to run my executable and interact with the I/O without using any simulink interface, is it possible ?


Sign in to comment.

fayçal ahmed zaid
fayçal ahmed zaid on 18 Aug 2016
After a long time of research here and there, I think you'll need to get the Embedded Coder Toolbox, in order to deploy your executables for PC without Matlab nor Simulink.

  1 Comment

Akhtar Zeb
Akhtar Zeb on 24 Jun 2019
So it is not possible to pass arguments (tune parameters) of the executable built using GRT (generic real-time target)?

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!