| 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

The S-Function Builder block creates a C MEX-file S-function from specifications and C source code that you provide. See Building S-Functions Automatically for detailed instructions on using the S-Function Builder block to generate an S-function.
Instances of the S-Function Builder block also serve as wrappers for generated S-functions in Simulink models. When simulating a model containing instances of an S-Function Builder block, Simulink software invokes the generated S-function associated with each instance to compute the instance's output at each time step.
Note The S-Function Builder block does not support masking. However, you can mask a Subsystem block that contains an S-Function Builder block. See Working with Block Masks in the Simulink documentation for more information. |
The S-Function Builder can accept and output complex, 1-D, or 2-D signals and nonvirtual buses. For each of these cases, the signals must have a data type which Simulink software supports.
For a discussion on the data types supported by Simulink software, see Data Types Supported by Simulink in the Simulink documentation.
See S-Function Builder Dialog Box in the online documentation for information on using the S-Function Builder block's parameter dialog box.
![]() | S-Function | Shift Arithmetic | ![]() |

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 |