Documentation Center

  • Trial Software
  • Product Updates

setPolyFormat

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

Syntax

model= setPolyFormat(model, 'cell')
model= setPolyFormat(model, 'double')

Description

model= setPolyFormat(model, 'cell') converts the B and F polynomials of a multi-input polynomial model, model, from double matrices to cell arrays. Each cell array has Nu-elements of double vectors, where Nu is the number of inputs.

model= setPolyFormat(model, 'double') allows you to continue using double matrices for the B and F polynomials. The model displays a message that it is in backward compatibility mode.

Examples

Convert the B and F polynomials of an estimated multi-input ARX model to cell arrays:

  1. Estimate a 3-input ARX model.

    % Load estimation data.
    load iddata8
    % Estimate model.
    m = arx(z8, [3 [2 2 1] [1 1 1]]); 

    The software computes the B and F polynomials and stores their values as double matrices in the b and f properties. Operations on the B and F polynomials, such as m.b, produce an incompatibility warning.

  2. Convert the B and F polynomials to cell arrays.

    m=setPolyFormat(m,'cell');

    To verify that the B and F polynomials are cell arrays, type class(m.b), which returns:

    ans =
    
    cell
  3. Extract pole and zero information from the model using cell array syntax.

    Poles1 = roots(m.f{1}); 
    Zeros1 = roots(m.b{1}); 
    
 

Continue using double matrices for B and F polynomials of an estimated multi-input ARX model:

  1. Estimate a 3-input ARX model.

    % Load estimation data.
    load iddata8
    % Estimate model.
    m = arx(z8, [3 [2 2 1] [1 1 1]]); 

    The software computes the B and F polynomials, and stores their values in double matrices in the b and f properties. Operations on the B and F polynomials, such as m.b, produce an incompatibility warning.

  2. Designate the model to continue using double matrices for the B and F polynomials for backward compatibility.

    m=setPolyFormat(m,'double')

    The following message at the MATLAB® prompt indicates that the model is backward compatible:

    (model configured to operate in backward compatibility mode)
  3. Extract pole and zero information from the model using matrix syntax.

    Poles1 = roots(m.f(1,:)) 
    Zeros1 = roots(m.b(1,:))
    

More About

expand all

Tips

  • The B and F polynomials, represented by b and f properties of idpoly object, are currently double matrices. For multi-input polynomial models, these polynomials will be cell arrays in a future version. Using setPolyFormat allows you to either change to using cell arrays immediately or continue using double arrays without errors in a future version.

  • After using model = setPolyFormat(model, 'cell'), update your code to use cell array syntax for operations on the b and f properties.

  • After using model = setPolyFormat(model, 'double'), you can continue using double matrix syntax for operations on the b and f properties.

  • setPolyFormat has no effect on single-input idpoly models, where the b and f properties continue to be represented by double row vectors.

See Also

| | | |

Was this topic helpful?