FILLBAD Linearly interpolate over bad data points. DATA=FILLBAD(DATA,FLAG), where DATA is a column vector and "bad" points within DATA are equal to FLAG, fills the bad points with a linear interpolation between the closest adjacent good points. FILLBAD(DATA) uses a value of NAN for FLAG. If DATA is a matrix, interpolation is performed along each column. FILLBAD(DATA,FLAG,MAXN) or FILLBAD(DATA,INDEX,MAXN) interpolates over gaps having a maximum length MAXN, which defaults to INF. For complex-valued data, the interpolation is performed on both the real and imaginary parts separately. For a FLAG of NAN, this means the data must contain NAN+SQRT(-1)*NAN. FILLBAD(...,STR) uses the interpolation method specified in STR. DATAC=FILLBAD(DATAC,...) also works when the input DATAC is a cell array of numerical arrays, DATAC{1}=DATA1, DATAC{2}=DATA2, etc. The output is then a cell array of the identical size. 'fillbad --t' runs a test. Usage: data=fillbad(data,flag); data=fillbad(data,flag,maxnan); _________________________________________________________________ This is part of JLAB --- type 'help jlab' for more information (C) 2000--2020 J.M. Lilly --- type 'help jlab_license' for details