Writing S-Functions | ![]() ![]() |
Processing S-Function Parameters
When invoking an M-file S-function, Simulink always passes the standard block parameters, t
, x
, u
, and flag
, to the S-function as function arguments. Simulink can pass additional block-specific parameters specified by the user to the S-function. The user specifies the parameters in the S-function parameters field of the S-function's block parameter dialog (see Passing Parameters to S-Functions). If the block dialog specifies additional parameters, Simulink passes the parameters to the S-function as additional function arguments. The additional arguments follow the standard arguments in the S-function argument list in the order in which the corresponding parameters appear in the block dialog. You can use this block-specific S-function parameter capability to allow the same S-function to implement various processing options. See the limintm.m
example in the toolbox/simulink/blocks
directory for an example of an S-function that uses block-specific parameters in this way.
![]() | Defining S-Function Block Characteristics | Examples of M-File S-Functions | ![]() |