Create C/C++ S-Functions
You can create C/C++ S-functions by writing an S-function from scratch, using the S-function builder, or using the Legacy Code Tool. Each of these approaches involves a tradeoff between the ease of writing an S-function and the features supported by the S-function.
About C/C++ S-Functions
Construct the code to create an S-function.
Learn how the Simulink® engine interacts with a C S-function to create and debug your own C S-functions.
Implement S-function callback methods.
Access Simulink data structure through SimStruct macros and functions.
Create C S-Functions
Use code templates as starting points for writing your own C S-functions.
Model systems through C MEX S-function examples.
Create various types of S-functions and S-function features.
mxArray manipulation in C S-functions.
Convert S-functions written for earlier Simulink releases to work with the current version.