I need to replace NaNs in a long time series that has consecutive (varying lengths) and non-consecutive NaNs. I tried the solution in this link https://au.mathworks.com/matlabcentral/answers/160575-replacing-nan-values-with-average-values-of-the-nearest-numbers but it doesn't seem to work for all my NaNs (not familiar with the bsxfun @(x,y)). Thanks for your help,
1438.600000000001446.53000000000NaN1426.850000000001414.340000000001419.980000000001418.460000000001420.290000000001426.090000000001422.12000000000NaNNaN1464.230000000001459.200000000001463.320000000001474.460000000001460.270000000001441.500000000001442.720000000001446.230000000001443.480000000001444.550000000001443.790000000001444.55000000000NaNNaNNaN1484.070000000001482.54000000000
Best Answer