| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → System Identification Toolbox |
| Contents | Index |
| Learn more about System Identification Toolbox |
TrendInfo class represents offset and linear trend information of input and output data. Constructing the corresponding object lets you:
Compute and store mean values or best-fit linear trends of input and output data signals.
Define specific offsets and trends to be removed from input-output data.
By storing offset and trend information, you can apply it to multiple data sets.
After estimating a linear model from detrended data, you can simulate the model at original operation conditions by adding the saved trend to the simulated output using retrend.
For transient data, if you want to define a specific offset or trend to be removed from this data, create the TrendInfo object using getTrend. For example:
T=getTrend(data)
where data is the iddata object from which you will be removing the offset or linear trend, and T is the TrendInfo object. You must then assign specific offset and slope values as properties of this object before passing the object as an argument to detrend.
For steady-state data, if you want to detrend the data and store the trend information, use the detrend command with the output argument for storing trend information.
After creating the object, you can use get or dot notation to access the object property values.
| Property Name | Default | Description |
|---|---|---|
| DataName | Empty string | Name of the iddata object from which trend information is derived (if any) |
| InputOffset | zeros(1,nu), where nu is the number of inputs |
For multiple experiment data, this is a cell array of size equal to the number of experiments in the data set. |
| InputSlope | zeros(1,nu), where nu is the number of inputs | Slope of linear trend in input data, computed automatically when using the detrend command to remove the linear trend in the data. For multiple experiment data, this is a cell array of size equal to the number of experiments in the data set. |
| OutputOffset | zeros(1,ny), where ny is the number of outputs |
For multiple experiment data, this is a cell array of size equal to the number of experiments in the data set. |
| OutputSlope | zeros(1,ny), where ny is the number of outputs | Slope of linear trend in output data, computed automatically when using the detrend command to remove the linear trend in the data. For multiple experiment data, this is a cell array of size equal to the number of experiments in the data set. |
Construct the object that stores trend information as part of data detrending:
% Load SISO data containing vectors u2 and y2 load dryer2 % Create data object with sampling time of 0.08 sec data=iddata(y2,u2,0.08) % Plot data on a time plot - it has a nonzero mean plot(data) % Detrend the mean from the data % Store the mean as TrendInfo object T [data_d,T] = detrend(data,0) % View mean value removed from the data get(T)
Construct the object that stores input and output offsets to be removed from transient data:
% Load SISO data containing vectors u2 and y2 load dryer2 % Create data object with sampling time of 0.08 sec data=iddata(y2,u2,0.08) % Plot data on a time plot - it has a nonzero mean plot(data) % Create a TrendInfo object for storing offsets and trends T = getTrend(data) % Assign offset values to the TrendInfo object T.InputOffset=5; T.OutputOffset=5; % Subtract specific offset from the data data_d = detrend(data,T) % View mean value removed from the data get(T)
| detrend |
| getTrend |
| retrend |
| Handling Offsets and Trends in Data |
![]() | treepartition | unitgain | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |