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.
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.
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.