I have some doubts on how to select the span in order to smooth all my NaN values and values.
For example, I got:
A = [5;7;9;19;NaN;NaN;NaN;NaN;5;NaN;7;NaN]
idx = [1:size(A,1)]'
B = smooth(idx,A,4,'loess')
If I use the span of 2, 3 or 4 I have the value "0" in some NaN's, if I use the span of 5, I got everything smoothed right.
I would like to know if it is possible, before doing the smooth code line, how to perform a calculation of span to ensure that the result doesn't have nan's?
Thanks for your time.