Writing S-Functions Previous page   Next Page
mdlDerivatives

Compute the S-function's derivatives

C Syntax

C Arguments

S
   SimStruct representing an S-Function block.

M Syntax

M Arguments

s
   Instance of Simulink.MSFcnRunTimeBlock class representing the S-Function block

Description

Simulink invokes this optional method at each time step to compute the derivatives of the S-function's continuous states. This method should store the derivatives in the S-function's state derivatives vector. This method can use ssGetdX to get a pointer to the derivatives vector.

Each time the mdlDerivatives routine is called, it must explicitly set the values of all derivatives. The derivative vector does not maintain the values from the last call to this routine. The memory allocated to the derivative vector changes during execution.

Example

For an example, see matlabroot/simulink/src/csfunc.c.

Languages

Ada, C, M

See Also

ssGetdx


Previous page  mdlCheckParameters mdlDisable Next page

© 1994-2005 The MathWorks, Inc.