Main Content

nparams

Number of model parameters

Syntax

np = nparams(sys)
np = nparams(sys,'free')

Description

np = nparams(sys) returns the number of parameters in the identified model sys.

np = nparams(sys,'free') returns the number free estimation parameters in the identified model sys.

Note

Not all model coefficients are parameters, such as the leading entry of the denominator polynomials in idpoly and idtf models.

Input Arguments

sys

Identified linear model.

Output Arguments

np

Number of parameters of sys.

For the syntax np = nparams(sys,'free'), np is the number of free estimation parameters of sys.

idgrey models can contain non-scalar parameters. nparams accounts for each individual entry of the non-scalar parameters in the total parameter count.

Examples

Obtain the number of parameters of a transfer function model.

sys = idtf(1,[1 2]);
np = nparams(sys);

Obtain the number of free estimation parameters of a transfer function model.

sys0 = idtf([1 0],[1 2 0]);
sys0.Structure.Denominator.Free(3) = false;
np = nparams(sys,'free');

Version History

Introduced in R2012a

See Also

| | | | | |