Read Consecutive Files in Consecutive Folders
Bellow is my script for reading some consecutive files in some consecutive folders.
year = 1979:2018;
n = length(year);
% READ THE FILES
for i = 1:n
folder{i} = (['G:\data\ERA_Interim_longterm\data\' num2str(year(i))]);
files{i}=dir([folder{i} '/*.nc']);
f(i)=length(files{i});
for k = 1:f(i)
filename{i,k} = [folder{i} '\' files{1,i}(k).name];
F{i,k}=ncgeodataset(filename{i,k});
end
end...