Writing S-Functions | ![]() ![]() |
The SimStruct
The file matlabroot
/simulink/include/
simstruc.h is a C language header file that defines the Simulink data structure and the SimStruct
access macros. It encapsulates all the data relating to the model or S-function, including block parameters and outputs.
There is one SimStruct
data structure allocated for the Simulink model. Each S-function in the model has its own SimStruct
associated with it. The organization of these SimStruct
s is much like a directory tree. The SimStruct
associated with the model is the root SimStruct
. The SimStruct
s associated with the S-functions are the child SimStruct
s.
Simulink provides a set of macros that S-functions can use to access the fields of the SimStruct
. See SimStruct Functions, for more information.
![]() | S-Function Source File Requirements | Compiling C S-Functions | ![]() |