Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

ssAddOutputDimsDependencyRule

Register a method to handle current dimensions update.

Syntax

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

Arguments

S

SimStruct representing 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++

Example

See the S-function sfun_varsize_holdStatesUntilReset.c.

Introduced in R2009b

Was this topic helpful?