Products & Services Solutions Academia Support User Community Company

Learn more about Simulink   

ssSetOutputPortMatrixDimensions - Specify dimension information for an output port that emits matrix signals

Syntax

int_T ssSetOutputPortMatrixDimensions(SimStruct *S, int_T port,  
 int_T m, in_T n)

Arguments

S

SimStruct representing an S-Function block.

port

Index of an output port.

m

Row dimension of matrix signals emitted by port or DYNAMICALLY_SIZED.

n

Column dimension of matrix signals emitted by port or DYNAMICALLY_SIZED.

Returns

1 if successful; otherwise, 0.

Description

Use this function to specify that port emits an m-by-n matrix signal. If either dimension is DYNAMICALLY_SIZED, the other must be DYNAMICALLY_SIZED or 1. If either dimension is dynamically sized, the S-function must provide mdlSetOutputPortDimensionInfo and mdlSetDefaultPortDimensionInfo methods to enable the signal dimensions to be set correctly during signal propagation.

Languages

C, C++

Example

The following example specifies that output port 0 emits 2-by-2 matrix signals.

ssSetOutputPortMatrixDimensions(S,  0, 2, 2);

See the S-function matlabroot/toolbox/simulink/simdemos/simfeatures/src/sfun_frmad.c used in sfcndemo_frame.mdl for a complete example that uses this function. Running this model requires a Signal Processing Blockset license.

See Also

ssGetOutputPortDimensions

  


Related Products & Applications

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

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