0001 function w=nt_find_outliers2(x,cutoff,iterations);
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 if nargin<1; error('!'); return; end
0012 if nargin<2 || isempty(cutoff); cutoff=2; end
0013 if nargin<3 || isempty(iterations); iterations=1; end
0014
0015 [m,n,o]=size(x);
0016 x=nt_unfold(x);
0017
0018 w=ones(size(x,1),1);
0019 if iterations>1
0020 w=nt_find_outliers2(x,cutoff,iterations-1);
0021 return
0022 end
0023
0024 d=mahal(x(find(w),:),x);
0025 d=d/n;
0026 w=d<cutoff;
0027
0028 w=nt_fold(w,m);