User`s guide
Overview of the C MEX S-Function Routines
3-19
Data View of S-Functions
S-function blocks have input and output signals, parameters, internal states,
plus other generalwork areas. In general, blockinputs and outputsarewritten
to, and read from, a block I/O vector. Inputs can also come from
• External inputs via the root inport blocks
• Ground if the input signal is unconnected or grounded
Block outputs can also go to the external outputs via the root outportblocks. In
addition to input and output signals, S-functions can have:
• Continuous states
• Discrete states
• Other working areas such as real, integer or pointer work vectors
S-function blocks can be parameterized by passing parameters them using the
S-function block dialog box.
The following picture shows the general mapping between these various types
of data:
Figure 3-4: The Relationships Among S-Functions and S-Function Data
Block
Block I/O
External
Outputs
(root
outport
External
Inputs
(root
inport
Ground
States
Work
Vectors,
RWork,
IWork,
PWork,
Parameters
blocks)
blocks)
...