Regarding reading diffrent files
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I have some .nc files for 13 years (13 files) e.g GTE_bb_CH_1997.nc,GTE_bb_CH_1998.nc,...., GTE_bb_CH_2009.nc I want to read and plot all files same time. So how I can write loop so I can read separate file for every year ?
0 Kommentare
Antworten (1)
Fangjun Jiang
am 19 Sep. 2011
Files=dir('*.nc');
for k=1:length(Files)
FileName=Files(k).name;
%load file
end
7 Kommentare
Fangjun Jiang
am 19 Sep. 2011
Try this:
dir_list=dir('*.nc');
for i=1:length(dir_list)
FileName=dir_list(i).name
end
Do you see 13 file names appear in the Command Window?
Siehe auch
Kategorien
Mehr zu Text Files finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!