Main Content

mdlSetInputPortWidth

Set the width of an input port that accepts 1-D (vector) signals

Required

No

Languages

C, C++

Syntax

#define MDL_SET_INPUT_PORT_WIDTH
void mdlSetInputPortWidth(SimStruct *S, int_T port, int_T width)

Arguments

S

SimStruct representing an S-Function block.

port

Index of a port.

width

Width of signal.

Description

This method is called with the candidate width for a dynamically sized port. If the proposed width is acceptable, the method should set the actual port width using ssSetInputPortWidth. If the size is unacceptable, an error should be generated via ssSetErrorStatus. Note that any other dynamically sized input or output ports whose widths are implicitly defined by virtue of knowing the width of the given port can also have their widths set via calls to ssSetInputPortWidth or ssSetOutputPortWidth. This method is only valid for simulation, and must be enclosed in a #if defined(MATLAB_MEX_FILE) statement.

The Simulink® engine invokes this method until all dynamically sized input ports are configured.

Version History

Introduced before R2006a