User`s guide
2 Getting Started with the Real-Time Workshop
2-12
Building Generic Real-Time Programs
This example describes how to generate C code from a Simulink model and
create a generic real-time program. This program:
• Executes as a stand-alone program, independent of external timing and
events
• Saves data in a MATLAB MAT-file for later analysis
• Is built in the UNIX and PC environments
It also demonstrates how to use data logging to validate the generated code.
Data logging allows you to compare system outputs from the Simulink block
diagram to the data stored by the program created from the generated code.
The Simulink Model
This example uses the f14 Simulink model from the simdemos directory (note
that, by default, this directory is on your MATLAB path).
f14 is a model of a
flight controller for the longitudinal motion of a Grumman Aerospace F-14
aircraft.
Naming Conventions This example is based on a model of the F-14
aircraft. When typed at the MATLAB prompt,
f14 opens the model. When
passed to the operating system,
!f14 executes the file named f14.Whenused
with the MATLAB load command,
load f14 reads from the file f14.mat.
Finally, the phrase F-14 refers to the aircraft.
To display the model with Simulink, at the MATLAB command line, enter:
f14