Specify format for B and F polynomials of multi-input polynomial model


  • modelOut = setPolyFormat(modelIn,'double')
  • modelOut = setPolyFormat(modelIn,'cell')



modelOut = setPolyFormat(modelIn,'double') converts the B and F polynomials of a multi-input polynomial model, modelIn, to double matrices.

By default, the B and F polynomials of an idpoly model are cell arrays. For MATLAB® scripts written before R2012a, convert the cell arrays to double matrices for backward compatibility using this syntax. For example:

model = arx(data,[3 2 2 1 1]);
model = setPolyFormat(model,'double');

modelOut = setPolyFormat(modelIn,'cell') converts the B and F polynomials of modelIn to cell arrays.

MATLAB data files saved before R2012a store idpoly models with their B and F polynomials represented as double matrices. If these models were previously set to operate in backward-compatibility mode, they are not converted to use cell arrays when loaded. Convert these models to use cell arrays using this syntax. For example:

load polyData.mat model;
model = setPolyFormat(model,'cell');


collapse all

Convert B and F Polynomials of a Multi-Input ARX Model to Double Matrices

Load estimation data.

load iddata8;

Estimate the model.

m1 = arx(z8,[3 [2 2 1] [1 1 1]]);

Convert the b and f polynomials to use double matrices.

m2 = setPolyFormat(m1,'double');

Extract pole and zero information from the model using matrix syntax.

Poles1 = roots(m2.F(1,:));
Zeros1 = roots(m2.B(1,:));

Related Examples

Input Arguments

collapse all

modelIn — Polynomial modelidpoly object

Polynomial model, specified as an idpoly object. The B and F polynomials of modelIn are either:

  • Cell arrays with Nu elements, where Nu is the number of model inputs, with each element containing a double vector. This configuration is the default.

  • Double matrices with Nu rows. This configuration applies to backward-compatible idpoly models stored in MATLAB data files before R2012a.

    Note:   setPolyFormat only supports multi-input, single-output models. Specifying modelIn as a:

    • Multi-output model generates an error.

    • Single-input, single-output model has no effect. The B and F polynomials remain as double vectors.

Output Arguments

collapse all

modelOut — Polynomial modelidpoly object

Polynomial model, returned as an idpoly object.

To access the b and f polynomials of modelOut, use:

  • Matrix syntax after using modelOut = setPolyFormat(modelIn,'double'). For example:

  • Cell array syntax after using modelOut = setPolyFormat(modelIn,'cell'). For example:


After using modelOut = setPolyFormat(modelIn,'cell'), you can resave the converted model in cell array format. For example:

save polyNew.mat modelOut;

More About

collapse all


  • To verify the current format of the B and F polynomials for a given idpoly model, enter:


    If the model uses double matrices, the displayed result is:

    ans =

    Otherwise, for cell arrays, the result is:

    ans =

See Also

| | | |

Introduced in R2010a

Was this topic helpful?