Size of input during Simulink propagation
size = propagatedInputSize(obj,index)
returns, as a vector, the input size of the specified System object™. The
size = propagatedInputSize(
index specifies the input for which to return the
size information. (Do not count the
obj in the
index. The first input is always
You can use
propagatedInputSize only from within the
getOutputSizeImpl method in your class definition file. Use
Your System object has more than one input or output.
The input size determines the output size.
The output size must differ from the input size.
For variable-size inputs, the propagated input size from
propagatedInputSize differs depending on the
propagatedInputSizereturns the size of the inputs used when you run the object for the first time.
propagatedInputSizereturns the upper bound of the input sizes.
By default, in Simulink® the MATLAB System block recognizes 1-D input
signals and propagates 1-D output signal as 2-D. Use
supports1DVectorsImpl method to enable the 1-D inputs and outputs to be
recognized and propagated as 1-D signals, respectively.
obj — System object
System object handle used to access properties, states, and methods specific to the object. If
propagatedInputSize method does not use the object, you can replace this
index — Input index
Index of the specified input
size — Input size
Size of the specified input, returned as a vector
Match Size of Input and Output
Get the size of the second input. If the first
dimension of the second input has a size greater than
then set the output size to a 1 x 2 vector. For all other cases, the
output is a 2 x 1 matrix. Assume that the first input has no impact
on the output size.
methods (Access = protected) function outsize = getOutputSizeImpl(obj) size = propagatedInputSize(obj,2); if size(1) == 1 outsize = [1,2]; else outsize = [2,1]; end end end
Introduced in R2014a