DETRENDNONLIN Removes non-linear trend from a vector.
The nonlinearity is removed by subtracting a least-squares
polynomial fit.
Y = DETRENDNONLIN(X) subtracts a second order polynomial fit from
the data vector X.
Y = DETRENDNONLIN(X, n) subtracts a polynomial fit of order n from
the data vector X.
Note: This function may throw errors generated in the function call to
POLYFIT.
Cite As
Atul Ingle (2026). Detrend Non-linear Data (https://www.mathworks.com/matlabcentral/fileexchange/35162-detrend-non-linear-data), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2011a
Compatible with any release
Platform Compatibility
Windows macOS LinuxCategories
Find more on Least Squares in Help Center and MATLAB Answers
Tags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0.0.0 |
