Home > freetb4matlab > tsa > detrend.m

detrend

PURPOSE ^

DETREND removes the trend from data, NaN's are considered as missing values

SYNOPSIS ^

function [X,T]=detrend(t,X,p)

DESCRIPTION ^

 DETREND removes the trend from data, NaN's are considered as missing values
 
 DETREND is fully compatible to previous Matlab and Octave DETREND with the following features added:
 - handles NaN's by assuming that these are missing values
 - handles unequally spaced data
 - second output parameter gives the trend of the data
 - compatible to Matlab and Octave 

 [...]=detrend([t,] X [,p])
    removes trend for unequally spaced data
    t represents the time points
    X(i) is the value at time t(i)
    p must be a scalar

 [...]=detrend(X,0)
 [...]=detrend(X,'constant')
    removes the mean

 [...]=detrend(X,p)
    removes polynomial of order p (default p=1)

 [...]=detrend(X,1) - default
 [...]=detrend(X,'linear')
    removes linear trend 

 [X,T]=detrend(...) 

 X is the detrended data
 T is the removed trend
 
 see also: SUMSKIPNAN, ZSCORE

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Sat 16-May-2009 00:04:49 by m2html © 2003