| Writing S-Functions | ![]() |
Introduction
Simulink provides an application programming interface (API) that lets you create custom blocks whose properties and behavior are defined by M-file programs called M-file S-functions. The Level-2 M-file S-function API allows you to create blocks that have all of the features and capabilities of Simulink's builtin blocks, including multiple input and output ports, the ability to accept vector or matrix signals of any data type supported by Simulink, real or complex signals, signal frames, and the ability to operate at multiple sample rates. For information on how to use the API to create custom blocks, see Writing Level-2 M-File S-Functions .
| Note This version of Simulink also supports a predecessor API, called Level 1, for writing M-file S-functions. This is done to ensure that Simulink can simulate models that use M-file S-function blocks developed for use with earlier Simulink releases (see Maintaining Level-1 M-File S-Functions) . You should not use the Level-1 API to develop new M-file S-functions. Instead, you should use the Level-2 API. |
| Writing S-Functions in M | Writing Level-2 M-File S-Functions | ![]() |
© 1994-2005 The MathWorks, Inc.