Writing S-Functions    

S-Function Examples

Most S-Function blocks require the handling of states, continuous or discrete. The following sections discuss common types of systems that you can model in Simulink with S-functions:

All examples are based on the C MEX-file S-function template, sfuntmpl.c, and sfuntmpl.doc, which contains a discussion of the S-function template.


 ssSetErrorStatus Termination Criteria Example - Continuous State S-Function