function [Xslope, Xstd, Xmean] = stationcrit (rng, X)
%computes criteria to determine and reject unstationary conditions
    Xslope=polyfit(rng-rng(1),X(rng)-nanmean1(X(rng)),1);       
    Xstd=nanstd1(X(rng));   
    Xmean=nanmean1(X(rng));
