Main Content

ssAddOutputDimsDependencyRule

Register a method to handle current dimensions update.

Syntax

void ssAddOutputDimsDependencyRule(SimStruct *S, int_T outIdx, DimsDependInfo_T *ruleInfo)

Arguments

S

SimStruct that represents an S-Function block.

outIdx

Output port index.

ruleInfo

Structure containing the dimensions propagation method information.

Returns

No return value

Description

Use this function in mdlSetWorkWidths to register a method that updates the dimensions for the output port when there is a change in the current input signal dimensions. The method is for the case when the output signal size depends only on the input signal size. It is called only when a dimensions update is necessary, instead of calling in each sim loop pass.

Requires you to set up a ruleinfo struct, which includes

  • int *inputs — Index to inputs whose dimensions affect the output dimensions

  • int numInputs — Number of inputs that affect the output dimensions

  • SetOutputDimsFcn — Function to update the output dimensions based on the input dimensions.

Languages

C, C++

Examples

See the S-function sfun_varsize_holdStatesUntilReset.c.

Version History

Introduced in R2009b