| MATLAB Function Reference | ![]() |
Subtract mean or best-fit line and all NaNs from time series
ts = detrend(ts1,method)
ts = detrend(ts1,Method,Index)
ts = detrend(ts1,method) subtracts either a mean or a best-fit line from time-series data, usually for FFT processing. Method is a string that specifies the detrend method and has two possible values:
'constant' — Subtracts the mean
'linear' — Subtracts the best-fit line
ts = detrend(ts1,Method,Index) uses the optional Index integer array to specify the columns or rows to detrend. When ts.IsTimeFirst is true, Index specifies one or more data columns. When ts.IsTimeFirst is false, Index specifies one or more data rows.
You cannot apply detrend to time-series data with more than two dimensions.
![]() | detrend | deval | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |