Hi Aslak, can you let me know how to how "abc" result as (a)-->(b)-->(c)-->(d)-->(e)-->(f) not (b)-->(a)-->(d)-->(c)-->(f)-->(e)

Please see this code:

subaxis(1,2,3,'sv',0,'sh',0.1)
spacing=10%
plot(1:6,randn(6,1))
for ii=2:6
subaxis(ii)
with
plot(1:6,randn(6,1))
end
samexaxis('abc','ytac')
set(subaxis(5),'xticklabelmode','auto')
set(subaxis(6),'xticklabelmode','auto')

Dear all, I'm dealing with gap filling on weather measurements which the NaN should be filled based on the time window of several days.(i.e., neighborhood hour of several days).

For example, one NaN at 5pm will be replaced by the mean value in the neighborhood hour of neighborhood several days. (let's say 4, 5 and 6pm of neighborhood 5 days)

Here is the bone of question I like to deal with:

values = rand(1,1000)';
fake_NaN = floor(rand(1,300)'*1000);
values(fake_NaN) = NaN;
for i = 1:length(values)
n = 24 * i * (1:5)
having_nan_index = find(isnan(values))
new_values = nanmean(values(having_nan_index * n-1:having_nan_index*n+1))
:
:
Something like that
:
:

If you have any solutions or advices, please feel free to let me know. Thanks, Michael

Hi I think there is a bug in nanmedian - i have a dataset (single row), DS, which contains no NaN values, but nanmedian(DS) = NaN. Matlab's normal median(DS)=0.
I think this is the problem - when the median actually equals zero, nanmedian thinks it =nan.

4

09 Aug 2012

NaN Suite
Descriptive Statistics for N-D matrices ignoring NaNs.

Comment only