User`s guide
3 Writing S-Functions As C-MEX files
3-84
}
}
#endif /* end mdlZeroCrossings */
/* Function: mdlTerminate =====================================================
* Abstract:
* No termination needed, but we are required to have this routine.
*/
static void mdlTerminate(SimStruct *S)
{
}
#ifdef MATLAB_MEX_FILE /* Is this file being compiled as a MEX-file? */
#include "simulink.c" /* MEX-file interface mechanism */
#else
#include "cg_sfun.h" /* Code generation registration function */
#endif
Example - Time Varying Continuous Transfer
Function
The stvctf S-function is an example of a time varying continuous transfer
function. It demonstrates how to work with the solvers so that the simulation
maintains consistency, which means that block maintains smooth and
consistent signals for the integrators despite the fact that the equations that
are being integrated are changing.