Version (982 Bytes) by leander moes
Detrends a matrix ignoring potential NaNs into the third dimension using linear least squares


Updated 15 Jul 2017

View License

Given a three-dimensional matrix the function detrends every row/column element along the third dimension. If NaN values exist those will be ignored while the remaining non-nan values in the same row/column pair will still get detrended. An optional argument allows to specify the time of each slice. For an example use and origin, see

Cite As

leander moes (2023). detrendNaN3 (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2015b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired by: detrend3

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes

title fix