Below is an elegant little routine to interpolate over NaN's. It's from Rich Pawlowicz's t_tide package.
You may wish to note the location of the NaNs so that you can re-insert them later.
ibad=isnan(y);
function y=fixgaps(x);
% FIXGAPS Linearly interpolates gaps in a time series
% YOUT=FIXGAPS(YIN) linearly interpolates over NaN
% in the input time series (may be complex), but ignores
% trailing and leading NaN.
%
% R. Pawlowicz 6/Nov/99
y=x;
bd=isnan(x);
gd=find(~bd);
bd([1:(min(gd)-1) (max(gd)+1):end])=0;
y(bd)=interp1(gd,x(gd),find(bd));