| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Simulink |
| Contents | Index |
| Learn more about Simulink |
User-Defined Functions
This block allows you to use a Level-2 M-file S-function (see "Writing Level-2 M-File S-Functions") in a model. To do this, create an instance of this block in the model. Then enter the name of the Level-2 M-File S-function in the M-file name field of the block's parameter dialog box.
If the Level-2 M-file S-function defines any additional parameters, you can enter them in the Parameters field of the block's parameter dialog box. Enter them as MATLAB expressions that evaluate to their values in the order defined by the M-file S-function. Use commas to separate each expression.
If a model includes a Level-2 M-File S-Function block, and an error occurs in the S-function, the Level-2 M-File S-Function block displays M-file stack trace information for the error in a dialog box. Click OK to remove the dialog box.
Depends on the M-file that defines the behavior of a particular instance of this block.

Name of an M-file that defines the behavior of this block. The M-file must follow the Level-2 standard for writing M-file S-functions (see "Writing Level-2 M-File S-Functions").
Values of the parameters of this block.
Direct Feedthrough | Depends on the M-file S-function |
Sample Time | Depends on the M-file S-function |
Scalar Expansion | Depends on contents M-file S-function |
Dimensionalized | Depends on the M-file S-function |
Multidimensionalized | Yes |
Zero Crossing | No |
![]() | Interval Test Dynamic | Logical Operator | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |