Make demean.m use nanmean
Otherwise estimation with missing observations and prefilter option will crashtime-shift
parent
ec35210e06
commit
92549e48b1
|
@ -47,9 +47,9 @@ function c = demean(x)
|
||||||
% Original author: stephane DOT adjemian AT univ DASH lemans DOT fr
|
% Original author: stephane DOT adjemian AT univ DASH lemans DOT fr
|
||||||
|
|
||||||
if ndim(x)==1
|
if ndim(x)==1
|
||||||
c = x-mean(x);
|
c = x-nanmean(x);
|
||||||
elseif ndim(x)==2
|
elseif ndim(x)==2
|
||||||
c = bsxfun(@minus,x,mean(x));
|
c = bsxfun(@minus,x,nanmean(x));
|
||||||
else
|
else
|
||||||
error('descriptive_statistics::demean:: This function is not implemented for arrays with dimension greater than two!')
|
error('descriptive_statistics::demean:: This function is not implemented for arrays with dimension greater than two!')
|
||||||
end
|
end
|
Loading…
Reference in New Issue