Add offsets or trends to data signals


data = retrend(data_d,T)


data = retrend(data_d,T) returns a data object data by adding the trend information T to each signal in data_d. data_d is a time-domain iddata object. T is an TrendInfo object.


Subtract means from input-output signals, estimate a linear model, and retrend the simulated output:

% Load SISO data containing vectors u2 and y2
load dryer2
% Create data object with sampling time of 0.08 sec
% Remove the mean from the data
[data_d,T] = detrend(data,0)
% Estimate a linear ARX model
m = arx(data_d,[2 2 1])
% Simulate the model output
% with zero initial states
y_sim = sim(m,data_d(:,[],:));
% Retrend the simulated model output
y_tot = retrend(y_sim,T);
Was this topic helpful?