Simulink Reference | ![]() ![]() |
Library
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 an M-file or MEX-file written as an 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 is always drawn with one input port and one output port, regardless of the number of inputs and outputs of the contained subsystem.
Vector lines are used when the S-function contains more than one input or output. The input vector width must match the number of inputs contained in the S-function. The block directs the first element of the input vector to the first input of the S-function, the second element to the second input, and so on. Likewise, the output vector width must match the number of S-function outputs.
Data Type Support
Depends on the implementation of the S-Function block.
Parameters and Dialog Box
Characteristics
![]() | Selector | S-Function Builder | ![]() |