addreg - Add custom regressors to idnalrx model

Syntax

addreg(model,R)
addreg(model,R,I)
addreg(model,R1,I1,R2,I2,Rn,In)

Input

model

Name of the idnlarx model object.

R

For single-output models, R can be an array of customreg objects. R can also be a cell array of strings, where each string is an expression in terms of input and output variables.

For multiple-output models with ny outputs, R can be a 1-by-ny cell array containing names of customreg objects or strings of expressions.

I

Scalar integer or vector of integers. Each integer specifies the index of a model output channel.

Description

addreg(model,R) adds one or more custom regressors R to a nonlinear ARX model. For multiple-output systems, each element of the R cell array is added to the corresponding output channel of the model.

addreg(model,R,I) is used for multiple-output models and adds one or more custom regressors R to specific output channels.

addreg(model,R1,I1,R2,I2,Rn,In) is used for multiple-output models and specifies the regressor-channel pairs.

Examples

The following example shows how to add regressors to a nonlinear ARX model using a cell array of strings. u1 and y2 are input and output variables, respectively:

m1 = idnlarx([4 2 1],'wavenet','nlr',[1:3]);
% Add regressors using cell array of strings
m2=addreg(m1,{'y1(t-2)^2';'u1(t)*y1(t-7)'})

Alternatively, you can use the customreg constructor to create regressors, and then add them to the model:

r1 = customreg(@(x)x^2, {'y1'}, 2)
r2 = customreg(@(x,y)x*y, {'u1','y1'}, [0 7])
m2=addreg(m1,[r1 r2]);

See Also

customreg 
getreg 
nlarx 
polyreg 

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS