Skip to content
Snippets Groups Projects
Commit 46179636 authored by Johannes Pfeifer's avatar Johannes Pfeifer Committed by Stéphane Adjemian
Browse files

Make demean.m use nanmean

Otherwise estimation with missing observations and prefilter option will crash

(cherry picked from commit 92549e48)
parent 38708d95
No related branches found
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