Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Error Handling

Handle unexpected events in S-Function blocks

S-Function Callback Methods

mdlOutputs Compute the signals that this block emits
mdlGetTimeOfNextVarHit Specify time of the next sample time hit
mdlUpdate Update a block's states
mdlDerivatives Compute the C MEX S-function's derivatives
mdlStart Initialize the state vectors of this C MEX S-function
mdlTerminate Perform any actions required at termination of the simulation

SimStruct Functions

ssGetErrorStatus Get a character vector that identifies the last error
ssPrintf Print a variable-content message
ssSetErrorStatus Report an error
ssWarning Display a warning message

Examples and How To

Error Handling

How to handle errors in a C S-function.

Concepts

S-Function Callback Methods

Description of S-function callback methods

S-Function SimStruct Functions

Overview of SimStruct macros and functions.

Was this topic helpful?