How to import multiple .nc files of different lengths
Show older comments
Hello,
I'm trying to import 164 3-D files of size 192x94x365(6). The files contain gridded climate data and are stored annually.
I'm struggling to import these into a single, large, 4-D file due to the extended length of the leap year files. Matlab returns a dimension mismatch.
I have this:
year=[1851:2014];
for ii=1:164
clear fnpath0 fname0 fname1;
fnpath0 = 'myfilepath';
fname0 = sprintf('uwnd.10m.%d.nc',year(ii));
fname1 = [fnpath0 fname0];
Uwndorg = ncread(fname1,'uwnd');
Uwndall(22:60,30:59,:,ii)=Uwndorg(22:60,30:59,:);
end
Accepted Answer
More Answers (0)
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!