RobustDetrend
Version 9.4.0 (1.65 KB) by
Geoffrey Schivre
Use robustfit to detrend polynomial trend in data
Find the best polynome order and detrend data while preserving peak features in data.
To generate the miniature :
x = linspace(0,1,1000)';
peak = 0.008.*exp(-((x-0.3).^2)./(2*(0.05^2)))+0.01.*exp(-((x-0.7).^2)./(2*(0.025^2)));
peak = peak+polyval([-0.021,+0.008,0.021,0],x);
peak = peak-0.001+0.002.*rand(size(peak));
[polorder,~,trend] = RobustDetrend(peak,6,0.975,x);
figure; plot(x,peak,'b.',x,trend,'r--')
Cite As
Geoffrey Schivre (2026). RobustDetrend (https://uk.mathworks.com/matlabcentral/fileexchange/69303-robustdetrend), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2018a
Compatible with R2017b and later releases
Platform Compatibility
Windows macOS LinuxCategories
Find more on Data Preprocessing 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 | |
|---|---|---|---|
| 9.4.0 |
