This is machine translation

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

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


Query number of dimensions of dynamic system model or model array


n = ndims(sys)


n = ndims(sys) is the number of dimensions of a dynamic system model or a model array sys. A single model has two dimensions (one for outputs, and one for inputs). A model array has 2 + p dimensions, where p ≥ 2 is the number of array dimensions. For example, a 2-by-3-by-4 array of models has 2 + 3 = 5 dimensions.

ndims(sys) = length(size(sys))


collapse all

Create a 3-by-1 array of random state-space models, each with 4 states, 1 input, and 1 output.

sys = rss(4,1,1,3);

Compute the number of dimensions of the model array.

ans = 4

The number of dimensions is 2+p, where p is the number of array dimensions. In this example, p is 2 because sys is 3-by-1.

See Also

Introduced in R2012a

Was this topic helpful?