Technical data

Inlining an S-Function
3-35
void
MdlDerivatives()
{
/* S-Function block: foo */
{
Simstruct *s = ssGetSFunction(S, 0);
real_T *sfcnU = ssGetU(s);
real_T *sfcnX = ssGetX(s);
real_T *sfcndX = ssGetdX(s);
sfcnDerivatives(sfcndX, sfcnX,
sfcnU, s, tid);
}
}
void
MdlTerminate()
{
/* S-Function block: foo */
{
Simstruct *s = ssGetSFunction(S, 0);
sfcnTerminate(s);
}
}
/* function to register model in
SimStruct */
Simstruct *
foogain()
{
:
:/* Normal model initialization code independent of
S-functions */
:
/* S-function initialization code required for all S-functions
without corresponding TLC files */
/* set number of children S-Functions */
ssSetNumSFunctions(S, 1);
Unnecessary call to
empty function
mdlDerivatives in
foogain.c.
Unnecessary call to
empty function
mdlTerminate in
foogain.c.