User`s guide
1 Data Processing
Before you can perform this task, you must represent your data as an iddata
object in the M ATLA B workspace, as described in “Representing Time- and
Frequency-Domain Data Using iddata Objects” on page 1-47.
To remove mean values from each channel in
data (which is an iddata
object), use the following syntax:
data = detrend(data);
To subtract one linear trend, use the following syntax:
data = detrend(data,1);
In this case, 1 indicates that a firs t-order trend is removed from each signal.
Note When you estimate a model from detrended data, you should also
detrend the validation data in the same way.
For more information about detrending options, see the detrend reference
page.
How to Add Detrended Values to the Model Output
Suppose that you estimated the model M using detrended data, w here you
removed
u0 an d y0 from the input and output signals, respectively.
To simulate this model about nonzero e quilibrium values:
1 Subtract u0 from the input signal you want to use to simulate the model.
For example,
Unew=U-u0.
2 Simulate the model using the sim command and the input signal resulting
from step 1.
For example,
Ysim = sim(M,Unew,INIT), where INIT specifies the initial
conditions of the simulation.
3 Add y0 to the simulated model output.
1-98