User`s guide
11 xPC Target and Fortran
11-2
Introduction
xPC Target supports Fortran in Simulink models with S-functions. (See
“Creating Fortran S-Functions” in the writing S-Functions documentation for
a description of how to incorporate Fortran code into Simulink models.) This
chapter describes how to incorporate Fortran into a Simulink model for xPC
Target.
This section has the following topics:
• “Simulink Demos Directory” on page 11-2
• “Prerequisites” on page 11-3
• “Steps to Incorporate Fortran in Simulink for xPC Target” on page 11-3
The example below uses one of the provided Fortran demo files, Atmosphere
model.
Simulink Demos Directory
The Simulink demos directory contains a tutorial and description on how to
incorporate Fortran code into a Simulink model using S-functions. To access
the tutorial and description,
1 In the MATLAB Command Window, type
demos
A list of MATLAB products appears on the left side of the window.
2 From the left side of the window, select Simulink, then Block
Diagramming Features
.
A list of Simulink examples appears on the right side of the window.
3 Click Custom Code and Hand Coded Blocks: M, C/C++, Fortran, etc.).
The associated Simulink demos page opens.
4 Click Open this model.
A library of S-function examples is displayed.