Documentation

Contents

MATLAB S-Functions

Create custom blocks defined by MATLAB® functions

Blocks

S-Function Include S-function in model

S-Function Callback Methods

setup Specify the number of inputs, outputs, states, parameters, and other characteristics of the MATLAB S-function
Outputs Compute the signals that this MATLAB S-function block emits
Terminate Perform any actions required at termination of the simulation
CheckParameters Check the validity of a MATLAB S-Function's parameters
Derivatives Compute a MATLAB S-Function's derivatives
Disable Respond to disabling of an enabled system containing this MATLAB S-Function block
Enable Respond to enabling of an enabled system containing this MATLAB S-Function block
GetSimState Return the MATLAB S-function simulation state as a valid MATLAB data structure, such as a matrix structure or a cell array.
InitializeConditions Initialize the state vectors of this MATLAB S-function
PostPropagationSetup Specify the sizes of the work vectors and create the run-time parameters required by this MATLAB S-function
ProcessParameters Process the MATLAB S-function's parameters
Projection Perturb the solver's solution of a system's states to better satisfy time-invariant solution relationships
SetInputPortComplexSignal Set the numeric types (real, complex, or inherited) of the signals accepted by an input port
SetInputPortDataType Set the data types of the signals accepted by an input port
SetInputPortDimensions Set the dimensions of the signals accepted by an input port
SetInputPortDimensionsMode Propagate the dimensions mode
SetInputPortSamplingMode Specify whether an input port accepts frame data
SetInputPortSampleTime Set the sample time of an input port that inherits its sample time from the port to which it is connected
SetOutputPortComplexSignal Set the numeric types (real, complex, or inherited) of the signals accepted by an output port
SetOutputPortDataType Set the data type of the signals emitted by an output port
SetOutputPortDimensions Set the dimensions of the signals accepted by an output port
SetOutputPortSampleTime Set the sample time of an output port that inherits its sample time from the port to which it is connected
SetSimState Set the simulation state of the MATLAB S-function by restoring the SimState.
SimStatusChange Respond to a pause or resumption of the simulation of the model that contains this MATLAB S-function
Start Initialize the state vectors of this MATLAB S-function
Update Update a block's states
WriteRTW Generate code generation data for the MATLAB S-function

Classes

Simulink.MSFcnRunTimeBlock Get run-time information about Level-2 MATLAB S-function block
Simulink.RunTimeBlock Allow Level-2 MATLAB S-function and other MATLAB programs to get information about block while simulation is running
Simulink.BlockData Provide run-time information about block-related data, such as block parameters
Simulink.BlockPortData Describe block input or output port
Simulink.BlockCompDworkData Provide postcompilation information about block's DWork vector
Simulink.BlockCompInputPortData Provide postcompilation information about block input port
Simulink.BlockCompOutputPortData Provide postcompilation information about block output port
Simulink.BlockPreCompInputPortData Provide precompilation information about block input port
Simulink.BlockPreCompOutputPortData Provide precompilation information about block output port

Was this topic helpful?