Depending on what you are looking for, there are two approaches you may consider:
1. Simulink Compiler
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. The standalone executables can be complete simulation apps that use MATLAB graphics and UIs designed with MATLAB App Designer. Refer to the following example:
Simulink Compiler also allows you to deploy a model to experiment and tune simulation parameters. Refer to the following example:
End users do not need full MATLAB or Simulink installations, they only need to install MATLAB Runtime to run and use the compiled simulation. To install MATLAB Runtime, direct end-users to the following website:
See the Simulink Compiler product page for more information about the product:
2. Simulink Coder
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":
See the Simulink Coder product page for more information about the product:
For more information on the differences between Simulink Compiler and Simulink Coder, refer to the following documentation page: