Documentation

Signal Access

Configure signal access for input and output ports

S-Function Callback Methods

mdlInitializeSizes Specify the number of inputs, outputs, states, parameters, and other characteristics of the C MEX S-function
mdlOutputs Compute the signals that this block emits
mdlSetWorkWidths Specify the sizes of the work vectors and create the run-time parameters required by this C MEX S-function

SimStruct Functions

ssGetNumInputPorts Get the number of input ports that a block has
ssGetNumOutputPorts Get the number of output ports that a block has
ssGetInputPortBufferDstPort Determine the output port that is sharing this input port's buffer
ssGetInputPortConnected Determine whether a port is connected to a nonvirtual block
ssGetInputPortOptimOpts Get the reusability setting of the memory allocated to the input port of an S-function
ssGetInputPortOverWritable Determine whether an input port can be overwritten
ssGetInputPortRealSignal Get the address of a real, contiguous signal entering an input port
ssGetInputPortRealSignalPtrs Get pointers to signals of type double connected to an input port
ssGetInputPortSignal Get the address of a contiguous signal entering an input port
ssGetInputPortSignalPtrs Get pointers to an input port's signal elements
ssGetOutputPortConnected Determine whether an output port is connected to a nonvirtual block
ssGetOutputPortBeingMerged Determine whether the output of this block is connected to a Merge block
ssGetOutputPortOptimOpts Get the reusability setting of the memory allocated to the output port of an S-function
ssGetOutputPortRealSignal Get a pointer to an output signal of type double (real_T)
ssGetOutputPortSignal Get the vector of signal elements emitted by an output port
ssSetInputPortOptimOpts Specify reusability of the memory allocated to the input port of an S-function
ssSetInputPortOverWritable Specify whether one of an S-function's input ports can be overwritten by one of its output ports
ssSetOutputPortOptimOpts Specify reusability of the memory allocated to the output port of an S-function
ssSetOutputPortOverwritesInputPort Specify whether an output port can share its memory buffer with an input port

Examples and How To

Input and Output Ports

How to create input and output ports on an S-function block.

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?