User`s guide

1 Overview of S-Functions
1-14
The simulink/blocks directory contains many M-file S-functions. Consider
starting off by looking at these files.
Table 1-2: Example M-File S-Functions
Filename Description
csfunc.m
Defines a continuous system in state-space format.
dsfunc.m
Define s a dis c ret e s y stem in state- sp a c e f o rm at.
vsfunc.m
Illustrates how to create a variabl e step block. This
block imp lem ent s a var iab le step delay in which t h e
first input is delayed by an a mount of time
determined by the second input.
mixed.m
Implements a hybrid system consisting of a
continuous int egrator in series with a unit delay.
vdpm.m
Implements t he Van der Pol equation.
simom.m
An example state-space M-file S-function with
internal
A, B, C,andDmatrices. This S-function
implements
dx/at = Ax + By
y = Cx + Du
where x is the state vector, u is the input vector, and
y is the output vector. The A, B, C,andDmatrices
areembeddedintheM-file.
simom2.m
An example state-space M-file S-function with
external
A, B, C,andDmatrices. The state-space
structure is the same as in
simom.m,buttheA,B,C,
and
D matrices are provided externally as
parameters to this file.
limintm.m
Implements a continuous limited integrator where
the output is bounded b y lower and upper bounds
and includes initial conditions.