Main Content


Add offsets or trends to time-domain data signals stored in iddata objects


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.


collapse all

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 a data object with sample time of 0.08 seconds.

data = iddata(y2,u2,0.08);

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

Version History

Introduced in R2009a