Skip to Main Content Skip to Search
Product Documentation

ssGetInputPortWidth - Get the width of an input port

Syntax

int_T ssGetInputPortWidth(SimStruct *S, int_T port)

Arguments

S

SimStruct representing an S-Function block.

port

Index of the port whose width is required.

Returns

An int_T value indicating the number of elements in the input signal. If the number of elements is unknown, returns DYNAMICALLY_SIZED.

Description

Gets the input port number of elements. If the input port is a 1-D array with w elements, this function returns w. If the input port is an M-by-N matrix, this function returns m*n. If m or n is unknown, this function returns DYNAMICALLY_SIZED. Use in any routine (except mdlInitializeSizes) to determine the width of an input port.

Languages

C, C++

Example

See the S-function sfun_zc_sat.c used in sfcndemo_sfun_zc_sat.mdl.

See Also

ssSetInputPortWidth

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS