Matlab/Simulink: Minimal empty template S-function

You can use this minimal, empty s-function as a template for getting started with your own S-function.

This minimal example also includes a template mdlStart().

Remember that if you rename the file, you also need to update the S_FUNCTION_NAME #define accordingly.

Compile using

Using -std=gnu++17 or newer is recommended, but not required.


Check out similar posts by category: Matlab/Simulink, C++