Main Content


Number of identified model parameters



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

    Not all model coefficients are parameters. For example, the leading entry of the denominator polynomials in idpoly and idtf models are not parameters.

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


    collapse all

    Create identified transfer function model.

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

    Obtain number of parameters in model.

    np = nparams(sys);

    Create a transfer function model where only the numerator parameters are free.

    sys0 = idtf([1 0],[1 2 0]);
    sys0.Structure.Denominator.Free(3) = false;

    Obtain number of free parameters from this model.

    np0 = nparams(sys,'free');

    Input Arguments

    collapse all

    Identified model, specified as one of the following model objects or an array of such objects.

    Output Arguments

    collapse all

    Number of parameters in identified, returned as an integer. If sys is a model array, then np is a vector or array of positive integers with the same dimensions as sys.

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

    Version History

    Introduced in R2012a

    See Also

    | | | | | |