Accelerating the pace of engineering and science

# Documentation Center

• Trial Software

# idParametric/getpar

Obtain attributes such as values and bounds of linear model parameters

## Description

example

value = getpar(sys,'value') returns the parameter values of the model sys. If sys is a model array, the returned value is a cell array of size equal to the model array.

example

free = getpar(sys,'free') returns the free or fixed status of the parameters.

example

bounds = getpar(sys,'bounds') returns the minimum and maximum bounds on the parameters.

example

label = getpar(sys,'label') returns the labels for the parameters.

example

getpar(sys) prints a table of parameter values, labels, free status and minimum and maximum bounds.

## Examples

expand all

### Get Parameter Values

Get the parameter values of an estimated ARMAX model.

Estimate an ARMAX model.

```load iddata8;
init_data = z8(1:100);
na=1;
nb=[1 1 1];
nc=1;
nk=[0 0 0];
sys = armax(init_data,[na nb nc nk]);```

Get the parameter values.

`val = getpar(sys,'value')`
```   -0.7511
-0.4302
0.4449
0.0101
0.3458```

To set parameter values, use sys = setpar(sys,'value',value).

### Get Free Parameters and Their Bounds

Get the free parameters and their bounds for a process model.

Construct a process model, and set its parameter values and free status.

```m = idproc('P2DUZI');
m.Kp = 1;
m.Tw = 100;
m.Zeta = .3;
m.Tz = 10;
m.Td = 0.4;
m.Structure.Td.Free = 0;
```

Here, the value of Td is fixed.

Get the parameter values.

```Val = getpar(m,'Value')
```
```    1.0000
100.0000
0.3000
0.4000
10.0000```

Get the free statuses of the parameters.

```Free = getpar(m, 'Free')
```
```     1
1
1
0
1```

The output indicates that Td is a fixed parameter and the remaining parameters are free.

Get the default bounds on the parameters.

```MinMax = getpar(m, 'bounds')
```
```  -Inf   Inf
0   Inf
0   Inf
0   Inf
-Inf   Inf
```

Extract the values of the free parameters.

```FreeValues = Val(Free)
```
```    1.0000
100.0000
0.3000
10.0000```

Extract the bounds on the free parameters.

`FreeValBounds = MinMax(Free,:)`
```  -Inf   Inf
0   Inf
0   Inf
-Inf   Inf```

### Get Parameter Labels

Get the parameter labels of an estimated ARMAX model.

Estimate an ARMAX model.

```load iddata8;
init_data = z8(1:100);
na=1;
nb=[1 1 1];
nc=1;
nk=[0 0 0];
sys = armax(init_data,[na nb nc nk]);```

Assign parameter labels.

`sys.Structure.a.Info(2).Label='a2';`

Get the parameter labels.

`label = getpar(sys,'label')`
```    'a2'
''
''
''
''```

### Obtain a Table of Model Parameter Attributes

Obtain a table of all model parameter attributes of an ARMAX model.

Estimate an ARMAX model.

```load iddata8;
init_data = z8(1:100);
na=4;
nb=[3 2 3];
nc=2;
nk=[0 0 0];
sys = armax(init_data,[na nb nc nk]);```

Get all parameter attributes.

`getpar(sys)`
```-----------------------------------------------------
#  Label     Value   Free       Min.         Max.
-----------------------------------------------------
1.         -1.4164    1       -Inf          Inf
2.         0.46882    1       -Inf          Inf
3.         0.24902    1       -Inf          Inf
4.        -0.10361    1       -Inf          Inf
5.        -0.13045    1       -Inf          Inf
6.          1.1777    1       -Inf          Inf
7.         0.43504    1       -Inf          Inf
8.         0.97551    1       -Inf          Inf
9.        0.038971    1       -Inf          Inf
10.        -0.17467    1       -Inf          Inf
11.         0.17177    1       -Inf          Inf
12.         0.47979    1       -Inf          Inf
13.         -1.8887    1       -Inf          Inf
14.         0.97541    1       -Inf          Inf```

## Input Arguments

expand all

### sys — Identified linear modelidss | idproc | idgrey | idtf | idpoly | Array of model objects

Identified linear model, specified as an idss, idpoly, idgrey, idtf, or idfrd model object or an array of model objects.

## Output Arguments

expand all

### value — Parameter valuesvector of doubles

Parameter values, returned as a double vector of length nparams(sys).

### free — Free or fixed status of parametersvector of logical values

Free or fixed status of parameters, returned as a logical vector of length nparams(sys).

### bounds — Minimum and maximum bounds on parametersmatrix of doubles

Minimum and maximum bounds on parameters, returned as a double matrix of size nparams(sys)-by-2. The first column contains the minimum bound, and the second column the maximum bound.

### label — Parameter labelscell array of strings

Parameter labels, returned as a cell array of strings of length nparams(sys).