Real-Time Workshop Embedded Coder | ![]() ![]() |
Real-Time Workshop Embedded Coder Demos
and Examples
Demos
We have provided a number of demos to help you become familiar with features of the Real-Time Workshop Embedded Coder and to inspect generated code. These demos illustrate features specific to the Real-Time Workshop Embedded Coder as well as general Real-Time Workshop features as used with the Embedded Coder.
If you are reading this document online in the MATLAB Help browser, you can run the demos by clicking on the links in the Command column of the following table.
Alternatively, you can access the demo suite by typing commands from the Command column of the table at the MATLAB command prompt, as in this example:
ecoderdemos
Command |
Demo Topic |
ecoderdemos |
Top-level demo containing buttons to run the other demos of the Real-Time Workshop Embedded Coder demo suite |
ecodertutorial |
Interactive tutorial on application deployment, configuring options, custom target development, and backwards compatibility issues. |
asap2demo |
ASAP2 data file generation |
atomicdemo |
Nonvirtual subsystem code generation |
cbdemo |
High-level optimizations in generated code |
cscdemos |
Code generation with custom storage classes. |
cscdesignintro |
How to design your own custom storage classes. |
cscpredefineddemo |
Use of the predefined custom storage classes |
cscvariantdemo |
Use of variant parameters |
cscgetsetdemo |
Use of the GetSet custom storage class with data store memory blocks |
ecdemo |
Generation of callable procedure with pure integer code; also creates HTML code generation report |
ecifdemo |
Use of control flow constructs such as if, while, and for |
exprfolding |
Expression folding: a technique that improves code efficiency by reducing use of temporary variables and expressions |
hierdemo |
Resolution of variable names within a model hierarchy |
objectdemo |
Use of Simulink data objects in simulation and code generation |
rtwecexamplemain |
Generating an example main program for a bare-board target without an operating system. |
sfexfold |
Expression folding in a model that integrates Stateflow and Embedded Coder |
ssdemo |
Advanced features of Embedded Coder, including subsystem code generation, HTML code generation report, and automatic S-function wrapper generation |
tunabledemo |
Use of tunable expressions in generated code |
ECRobot Target Example
The ECRobot (Embedded Coder Robot) target is a simple example of a custom target based on the Real-Time Workshop Embedded Coder.
Programs generated by the ECRobot target run on the Robot Command System (RCXTM) module of the LEGO® MINDSTORMSTM Robotics Invention System2.0TM.
This platform affords an inexpensive and simple way to study concepts and techniques essential to developing a custom embedded target, and to develop, run and observe generated programs. The files included with the target illustrate typical approaches to problems encountered in custom target development, including
The ECRobot target, originally developed as a training class example and demonstration, is now available to all Real-Time Workshop Embedded Coder users. The ECRobot target files are automatically installed with the Real-Time Workshop Embedded Coder. Source code files, control files, demonstration models, and documentation for the target are installed in the directory matlabroot
/toolbox/rtw/targets/ECRobot
.
![]() | Introduction | Data Structures and Program Execution | ![]() |