Quantcast

Documentation Center

  • Trial Software
  • Product Updates

setpvec

Modify value of model parameters

Syntax

sys = setpvec(sys0,par)
sys = setpvec(sys0,par,'free')

Description

sys = setpvec(sys0,par) modifies the value of the parameters of the identified model sys0 to the value specified by par.

par must be of length nparams(sys0). nparams(sys0) returns a count of all the parameters of sys0.

sys = setpvec(sys0,par,'free') modifies the value of all the free estimation parameters of sys0 to the value specified by par.

par must be of length nparams(sys0,'free'). nparams(sys0,'free') returns a count of all the free parameters of sys0.

Input Arguments

sys0

Identified model containing the parameters whose value is modified to par.

par

Replacement value for the parameters of the identified model sys0.

For the syntax sys = setpvec(sys0,par), par must be of length nparams(sys0). nparams(sys0) returns a count of all the parameters of sys0.

For the syntax sys = setpvec(sys0,par,'free'), par must be of length nparams(sys0,'free'). nparams(sys0,'free') returns a count of all the free parameters of sys0.

Use NaN to denote unknown parameter values.

If sys0 is an array of models, then specify par as a cell array with an entry corresponding to each model in sys0.

Output Arguments

sys

Identified model obtained from sys0 by updating the values of the specified parameters.

Examples

Modify the parameter values of a transfer function model.

The goal here is to ultimately use the transfer function model to initialize a model estimation.

sys0 = idtf(1,[1 2]);
par = [1; NaN; 0];
sys = setpvec(sys0,par);
 

Modify the value of the free parameters of a transfer function model.

sys0 = idtf([1 0],[1 2 0]);
sys0.Structure.den.Free(3) = false
par = [1; 2; 1]
sys = setpvec(sys0,par,'free');

See Also

| |

Was this topic helpful?