Main Content

Derivatives

Compute a MATLAB S-Function's derivatives

Required

No

Language

MATLAB®

Syntax

Derivatives(s)

Arguments

s

Instance of Simulink.MSFcnRunTimeBlock class representing the Level-2 MATLAB S-Function block

Description

The Simulink® engine 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. In a Level-2 MATLAB S-function, use the run-time object's Derivatives method.

Each time the Derivatives 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.

Examples

For a Level-2 MATLAB S-function example, see msfcn_limintm.m.

Version History

Introduced in R2012b