User`s guide
3 Writing S-Functions As C-MEX files
3-6
mdlOutputs
Calculation of outputs. For our timestwo
S-function, mdlOutputs takes the input,
multiplies it by two, and writes the
answer to the output. This routine is
called du ring the simulation loop each
time t he output of
timestwo needs to be
updated. For the above block diagram, it
is called at every time step.
mdlTerminate
Perform tasks at end of simulation. The
timestwo S-function has no t ermination
tasks to perform; therefore, this routine is
empty.
Table 3-1: S-Function Routines Called
During Simulation of the timestwo Example (Continued)
S-Function Routine Description