Writing S-Functions    
ssSetSolverNeedsReset

Ask Simulink to reset the solver.

Syntax

Arguments

S
   SimStruct representing an S-Function block or a Simulink model.

Description

This macro causes the solver for the current simulation to reinitialize variable step size and zero-crossing computations. This happens only if the solver is a variable-step, continuous solver. (The macro has no effect if the user has selected another type of solver for the current simulation.) An S-function should invoke this macro whenever changes occur in the dynamics of the S-function, e.g., a discontinuity in a state or output, that might invalidate the solver's step-size computations. Otherwise, the solver might take unnecessarily small steps, slowing down the simulation.

Languages

C

Example

The following example uses this macro to ask Simulink to reset the solver.

Also see the source code for the Time-Varying Continuous Transfer Function (matlabroot/simulink/src/stvctf.c) for an example of where and how to use this macro.


  ssSetSFcnParamTunable ssSetStopRequested