I have several files of different name such as SOx_AGRICULTURE_1x1km.nc or PM2.5_TRAN​SPORT_1x1k​m.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.

7 visualizaciones (últimos 30 días)
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

Respuesta aceptada

KSSV
KSSV el 15 de Jun. de 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

Más respuestas (0)

Categorías

Más información sobre Agriculture en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by