User`s guide
12 Configuring Real-Time Workshop for Your Application
12-18
S-Function Code Format
The S-function code format (corresponding to the RTW S-function target)
generates code so that you can use the model as a (C MEX) S-function block in
another model. This format has these applications:
• Componentize a model — You can generate an object file for a model,
m1,in
the S-function format. Then, you can place the generated S-function block in
another model,
m2. Regenerating code for m2 will not require regenerating
code for
m1.
• Speeding up simulation — You can generate an S-function for your model
and then use different inputs to test the model. For example, the model
sfun
is pictured below.
Generating code and compiling it for an S-function target results in the block
sfun_sf, which is an RTW S-Function block that contains all the