This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


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

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,:));

Input Arguments

collapse all

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.


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

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;


  • 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 =

Introduced in R2010a