Simulink Reference Previous page   Next Page
S-Function

Include an S-function in a model.

Library

User-Defined Functions

Description


The S-Function block provides access to S-functions from a block diagram. The S-function named as the S-function name parameter can be a Level-1 M-file or a Level-1 or Level-2 C MEX-file S-function (see Overview of S-Functions in Writing S-Functions for information on how to create S-functions).

The S-Function block allows additional parameters to be passed directly to the named S-function. The function parameters can be specified as MATLAB expressions or as variables separated by commas. For example,

Note that although individual parameters can be enclosed in brackets, the list of parameters must not be enclosed in brackets.

The S-Function block displays the name of the specified S-function and the number of input and output ports specified by the S-function. Signals connected to the inputs must have the dimensions specified by the S-function for the inputs.

Data Type Support

Depends on the implementation of the S-Function block.

Parameters and Dialog Box

S-function name
The S-function name.
S-function parameters
Additional S-function parameters. See the preceding block description for information on how to specify the parameters.
S-function modules
This parameter applies only if this block represents a C MEX-file S-function and you intend to use the Real-Time Workshop to generate code from the model containing the block. See "S-Function Module Names for Real-Time Workshop Builds" in the Real-Time Workshop online documentation for information on using this parameter.

Characteristics

Direct Feedthrough
Depends on contents of S-function
Sample Time
Depends on contents of S-function
Scalar Expansion
Depends on contents of S-function
Dimensionalized
Depends on contents of S-function
Zero Crossing
No


Previous page  Selector S-Function Builder Next page

© 1994-2005 The MathWorks, Inc.