
function ygood = fixnan(x,y)
%function ygood = fixnan(x,y)
% this spline fills the numbers in y array which are marked
% with NaN.  Use rmpoints.m to create that array
%  x is the x axis array filled with all good values
% This can be a very slow running program!!!
% In fact spline creates an NxN array which can fill memory
% Therefore do not try to use this if x array is larger than ~1500

good = find(y~=NaN);

yg = y(good);
xg = x(good);
ygood = spline(xg,yg,x);
