| Control System Toolbox™ | ![]() |
| On this page… |
|---|
I/O and Array Dimensions of LTI Arrays Accessing the Dimensions of an LTI Array Using size and ndims |
The dimensions and size of a single LTI model are determined by the output and input channels. An array of LTI models has additional quantities that determine its dimensions, size, and shape.
There are two sets of dimensions associated with LTI arrays:
The I/O dimensions—the output dimension and input dimension common to all models in the LTI array
The array dimensions—the dimensions of the array of models itself
The size of the LTI array is determined by:
The lengths of the I/O dimensions—the number of outputs (or inputs) common to all models in the LTI array
The length of each array dimension—the number of models along that array dimension
The next figure illustrates the concepts of dimension and size for the LTI array m2d, a 2-by-3 array of one-input, two-output transfer function models.
Dimensions and Size of m2d, an LTI Array

You can load this sample LTI array into your workspace by typing
load LTIexamples size(m2d) 2x3 array of continuous-time transfer functions Each transfer function has 2 outputs and 1 input.
The I/O dimensions correspond to the row and column dimensions of the transfer matrix. The two I/O dimensions are both of length 1 for SISO models. For MIMO models the lengths of these dimensions are given by the number of outputs and inputs of the model.
Five related quantities are pertinent to understanding the array dimensions:
N, the number of models in the LTI array
K, the number of array dimensions
, the list of lengths
of the array dimensions
is the number of
models along the
dimension.
, the configuration
of the models in the array
The configuration determines the shape of the array.
The product of these integers
is N.
In the example model m2d,:
The length of the output dimension, the first I/O dimension, is 2, since there are two output channels in each model.
The length of the input dimension, the second I/O dimension, is 1, since there is only one input channel in each model.
N, the number of models in the LTI array, is 6.
K, the number of array dimensions, is 2.
The array dimension lengths are [2 3].
The array configuration is 2-by-3.
You can access the dimensions and shape of an LTI array using
size to determine the lengths of each of the dimensions associated with an LTI array
ndims to determine the total number of dimensions in an LTI array
When applied to an LTI array, size returns
[Ny Nu S1 S2 ... Sk]
where
Ny is the number of outputs common to all models in the LTI array.
Nu is the number of inputs common to all models in the LTI array.
S1 S2 ... Sk are the lengths of the array dimensions of a k-dimensional array of models. Si is the number of models along the ith array dimension.
Note the following when using the size function:
By convention, a single LTI model is treated as a 1-by-1 array of models.
For single LTI models, size returns only the I/O dimensions [Ny Nu].
For LTI arrays, size always returns at least two array dimensions. For example, the size of a 2-by-1 LTI array in [Ny Nu 2 1]
size ignores trailing singleton dimensions beyond the second array dimension. For example, size returns [Ny Nu 2 3] for a 2-by-3-by-1-by-1 LTI array of models with Ny outputs and Nu inputs.
The function ndims returns the total number of dimensions in an LTI array:
2, for single LTI models
2 + p, for LTI arrays, where p (greater than 2) is the number of array dimensions
Note that
ndims (sys) = length(size(sys))
To see how these work on the sample 2-by-3 LTI array m2d of two-output, one-input models, type
load LTIexamples
s = size(m2d)
s =
2 1 2 3
Notice that size returns a vector whose entries correspond to the length of each of the four dimensions of m2d: two outputs and one input in a 2-by-3 array of models. Type
ndims(m2d)
ans =
4
to see that there are indeed four dimensions attributed to this LTI array.
Use reshape to reorganize the arrangement (array configuration) of the models of an existing LTI array.
For example, to arrange the models in an LTI array sys as a
array, type
reshape(sys,w1,...,wp)
where w1,...,wp are any set of integers whose product is N, the number of models in sys.
You can reshape the LTI array m2d into a 3-by-2, a 6-by-1, or a 1-by-6 array using reshape. For example, type
load LTIexamples
sys = reshape(m2d,6,1);
size(sys)
6x1 array of continuous-time transfer functions
Each transfer function has 2 outputs and 1 inputs.
s = size(sys)
s =
2 1 6 1
![]() | Concept of an LTI Array | Building LTI Arrays | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |