Commit 92549e48 authored by Johannes Pfeifer 's avatar Johannes Pfeifer

Make demean.m use nanmean

Otherwise estimation with missing observations and prefilter option will crash
parent ec35210e
......@@ -47,9 +47,9 @@ function c = demean(x)
% Original author: stephane DOT adjemian AT univ DASH lemans DOT fr
if ndim(x)==1
c = x-mean(x);
c = x-nanmean(x);
elseif ndim(x)==2
c = bsxfun(@minus,x,mean(x));
c = bsxfun(@minus,x,nanmean(x));
else
error('descriptive_statistics::demean:: This function is not implemented for arrays with dimension greater than two!')
end
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment