%
% clc, clear
% [num,txt,raw] = xlsread('D:\Weihe\mat\凤翔19600101_20201231.xlsx');
% station_name = txt(2,2); station_id = num(1,2); lon = num(4,2); lat = num(3,2); elev = num(5,2);
%
% a3 = find(isnan(num(:,1)) == 1);
% num(a3,:) = []; clear a3 raw txt
%
% for k = 1:size(num,1);
% time0 = num2str(num(k,1));
% time(k,1) = str2num(time0(1:4)); time(k,2) = str2num(time0(5:6)); time(k,3) = str2num(time0(7:8));
% time(k,4) = datenum(str2num(time0(1:4)), str2num(time0(5:6)), str2num(time0(7:8)));
% time(k,5) = dayofyear(str2num(time0(1:4)), str2num(time0(5:6)), str2num(time0(7:8)),0,0,0);
% preci(k,1) = num(k,2);
% clear time0
% end, clear k num
% save(strcat('D:\Weihe\mat\Step01_PrecipProcess_',num2str(station_id)));
clc,clear
load('D:\Weihe\mat\Step01_PrecipProcess_57025.mat');
a3 = find(isnan(preci) == 1);
if length(a3) < length(preci) * 0.1; % only station with missing-values less than 10% of total series
for k = 1:length(a3);
date0 = time(a3(k),5);
b3 = find(time(:,5) == date0);
[~, ia] = setdiff(b3,a3(k)); res = b3(sort(ia)); clear b3 ia
preci(a3(k)) = nanmean(preci(res)); clear date0 res
end, clear k
end, clear a3
运行时显示错误使用 load
找不到文件或目录 'D:\Weihe\mat\Step01_PrecipProcess_57025.mat'。