Using Simulink    

Determining Output Signal Dimensions

If a block can emit nonscalar signals, the dimensions of the signals that the block outputs depend on the block's parameters, if the block is a source block; otherwise, the output dimensions depend on the dimensions of the block's input and parameters.

Determining the Output Dimensions of Source Blocks

A source block is a block that has no inputs. Examples of source blocks include the Constant block and the Sine Wave block. See the Sources Library table in the online Simulink help for a complete listing of Simulink source blocks. The output dimensions of a source block are the same as those of its output value parameters if the block's Interpret Vector Parameters as 1-D parameter is off (i.e., not selected in the block's parameter dialog box). If the Interpret Vector Parameters as 1-D parameter is on, the output dimensions equal the output value parameter dimensions unless the parameter dimensions are N-by-1 or 1-by-N. In the latter case, the block outputs a vector signal of width N.

As an example of how a source block's output value parameter(s) and Interpret Vector Parameters as 1-D parameter determine the dimensionality of its output, consider the Constant block. This block outputs a constant signal equal to its Constant value parameter. The following table illustrates how the dimensionality of the Constant value parameter and the setting of the Interpret Vector Parameters as 1-D parameter determine the dimensionality of the block's output.

Constant Value
Interpret Vector Parameters as 1-D
Output
2-D scalar
off
2-D scalar
2-D scalar
on
1-D scalar
1-by-N matrix
off
1-by-N matrix
1-by-N matrix
on
N-element vector
N-by-1 matrix
off
N-by-1 matrix
N-by-1 matrix
on
N-element vector
M-by-N matrix
off
M-by-N matrix
M-by-N matrix
on
M-by-N matrix

Simulink source blocks allow you to specify the dimensions of the signals that they output. You can therefore use them to introduce signals of various dimensions into your model.

Determining the Output Dimensions of Nonsource Blocks

If a block has inputs, the dimensions of its outputs are, after scalar expansion, the same as those of its inputs. (All inputs must have the same dimensions, as discussed in the next section.)


  Signal Glossary Signal and Parameter Dimension Rules