1 function [x,z] = nanfilter1uc(uc,x,z);
2 % NANFILTER1UC is an adaptive filter for data with missing values encoded as NaN.
4 % [Y,Z] = nanfilter1uc(uc,X [, Z]);
6 % if X contains no missing data, NANFILTER behaves like FILTER(uc,[1,uc-1],X[,Z]).
8 % see also: FILTER, NANFILTER, SUMSKIPNAN
11 % Copyright (C) 2010,2011 by Alois Schloegl <alois.schloegl@gmail.com>
12 % This function is part of the NaN-toolbox available at
13 % http://pub.ist.ac.at/~schloegl/matlab/NaN/ and
14 % http://octave.svn.sourceforge.net/viewvc/octave/trunk/octave-forge/extra/NaN/inst/
16 % This program is free software; you can redistribute it and/or modify
17 % it under the terms of the GNU General Public License as published by
18 % the Free Software Foundation; either version 3 of the License, or
19 % (at your option) any later version.
21 % This program is distributed in the hope that it will be useful,
22 % but WITHOUT ANY WARRANTY; without even the implied warranty of
23 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 % GNU General Public License for more details.
26 % You should have received a copy of the GNU General Public License
27 % along with this program; if not, write to the Free Software
28 % Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
48 acc(~ix) = (1-UC1(~ix)) .* x(k,~ix) + z(~ix); % / A{1};