I have several files of different name such as SOx_AGRICULTURE_1x1km.nc or PM2.5_TRANSPORT_1x1km.nc. I have 40 files, my question is if I can open them as a "for" loop in matlab? In advance thank you very much for your response.
1 view (last 30 days)
Show older comments
I have several files of different name such as SOx_AGRICULTURE_1x1km.nc or PM2.5_TRANSPORT_1x1km.nc. I have 40 files, my question is if I can open them as a "for" loop in matlab?
In advance thank you very much for your response.
Best regards
0 Comments
Accepted Answer
KSSV
on 15 Jun 2016
Yes you can open them in a for loop.
ncfiles = dir('*.nc') ; % you are in the folder of nc files
%
Nfiles = length(ncfiles) ; % Total number of nc files
for i = 1:Nfiles % loop for each file
%%ncread
%%do what ever you want
end
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!