主要内容

size

Query output/input/array dimensions of input–output model and number of frequencies of FRD model

语法

size(sys)
d = size(sys)
Ny = size(sys,1)
Nu = size(sys,2)
Sk = size(sys,2+k)
Nf = size(sys,'frequency')

说明

When invoked without output arguments, size(sys) returns a description of type and the input-output dimensions of sys. If sys is a model array, the array size is also described. For identified models, the number of free parameters is also displayed. The lengths of the array dimensions are also included in the response to size when sys is a model array.

d = size(sys) returns:

  • The row vector d = [Ny Nu] for a single dynamic model sys with Ny outputs and Nu inputs

  • The row vector d = [Ny Nu S1 S2 ... Sp] for an S1-by-S2-by-...-by-Sp array of dynamic models with Ny outputs and Nu inputs

Ny = size(sys,1) returns the number of outputs of sys.

Nu = size(sys,2) returns the number of inputs of sys.

Sk = size(sys,2+k) returns the length of the k-th array dimension when sys is a model array.

Nf = size(sys,'frequency') returns the number of frequencies when sys is a frequency response data model. This is the same as the length of sys.frequency.

示例

全部折叠

Create a 3-by-1 model array of random state-space models with 3 outputs, 2 inputs, and 5 states.

sys = rss(5,3,2,3);

Verify the size of the model array.

size(sys)
3x1 array of state-space models.
Each model has 3 outputs, 2 inputs, and 5 states.

Create a 2-input 2-output continuous-time process model with identifiable parameters.

type = {'p1d','p2';'p3uz','p0'};
sys = idproc(type);

Each element of the type cell array describes the model structure for the corresponding input-output pair.

Query the input-output dimensions and number of free parameters in the model.

size(sys)
Process model with 2 outputs, 2 inputs and 12 free parameters.

版本历史记录

在 R2006a 之前推出

另请参阅

| | |