Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

specific files reading from folder

2 Ansichten (letzte 30 Tage)
Uday
Uday am 17 Aug. 2011
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
I have 2 years data 2009 & 2010, the data files are in daily format (365/year).
I would like to read monthly data .e.g for January month I would like to read first 31 files,for feb 28 or 29 and so on. data file name shows us year, month and day (e.g stt_20090101.hdf5). could somebody please tell me how I can use for loop to read these files same time for year and month as well. thank you

Antworten (1)

Fangjun Jiang
Fangjun Jiang am 17 Aug. 2011
AllDates=datevec(datenum('2009/1/1')+(0:750));
Year=2009;
Month=2;
SelectedDates=AllDates(and(AllDates(:,1)==Year,AllDates(:,2)==Month),1:3);
for k=1:size(SelectedDates,1)
filename=sprintf('stt_%d%02d%02d.hdf5',SelectedDates(k,:))
end

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by