Skip to content
Snippets Groups Projects
Commit 92549e48 authored by Johannes Pfeifer's avatar Johannes Pfeifer
Browse files

Make demean.m use nanmean

Otherwise estimation with missing observations and prefilter option will crash
parent ec35210e
Branches
Tags
No related merge requests found
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment