FUNCTION REFERENCE
detrend
Remove a linear trend or the mean.
Remove a linear trend or the mean.
Syntax
y = detrend(x)Syntax
y = detrend(x, 'linear')Syntax
y = detrend(x, 'constant')Removes the least-squares line ('linear', the default, or 1) or the mean
('constant', or 0) from a vector, or from each column of a matrix.
Example
detrend([1 2 4 7]) % [0.5 -0.5 -0.5 0.5]Differences from MATLAB: breakpoints (a third argument) are not supported
yet; complex input is not supported yet.
For an iddata object, detrend(data) removes the mean of every output and
input channel and detrend(data, 1) the least-squares line; the result is an
iddata object. Example: detrend(iddata([1;2;4],[0;1;0],1)).OutputData
These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.