Simulink Coder

Generate C and C++ code from Simulink and Stateflow models

Simulink® Coder™ (formerly Real-Time Workshop®) generates and executes C and C++ code from Simulink models, Stateflow® charts, and MATLAB® functions. The generated source code can be used for real-time and non-real-time applications, including simulation acceleration, rapid prototyping, and hardware-in-the-loop testing. You can tune and monitor the generated code using Simulink or run and interact with the code outside MATLAB and Simulink.

Getting Started

Learn the basics of Simulink Coder

Model Architecture and Design

Model componentization, hierarchy, and execution order considerations for code generation

Data, Function, and File Definition

Control of model data and elements in generated code

Code Generation

C/C++ code generation and debugging, report generation

Deployment

Deployment of executable programs and shared libraries

Performance

Reduce memory usage and improve execution speed of generated code

Verification

Compare model and generated code simulation results

Supported Hardware

Support third-party hardware with Simulink Coder.


Check Bug Reports for Issues and Fixes

Software is inherently complex and is not free of errors. The output of a code generator might contain bugs, some of which are not detected by a compiler. MathWorks reports critical known bugs brought to its attention on its Bug Report system at www.mathworks.com/support/bugreports/. In the search bar, type the phrase "Incorrect Code Generation" to obtain a report of known bugs that produce code that might compile and execute, but still produce wrong answers. To save a search, click Save Search.

The bug reports are an integral part of the documentation for each release. Examine periodically all bug reports for a release, as such reports may identify inconsistencies between the actual behavior of a release you are using and the behavior described in this documentation.

In addition to reviewing bug reports, you should implement a verification and validation strategy to identify potential bugs in your design, code, and tools.

Search R2019b Bug Reports

Known Bugs for Incorrect Code Generation
All Known Bugs for This Product