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 ビュー (過去 30 日間)
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

採用された回答

KSSV
KSSV 2016 年 6 月 15 日
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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAgriculture についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by