How do I make my a variable count only months instead of each day?
StartDate1 = num2str(StartDate); %date to string
StartDate2=datenum(StartDate1,'yyyymmdd'); %date to serial date number
EndDate1 = num2str(EndDate);EndDate2=datenum(EndDate1,'yyyymmdd');Dates=[StartDate2:EndDate2];startvecs = datevec(StartDate2);endvecs = datevec(EndDate2);diffvecs = endvecs - startvecs;countmonths = 12*diffvecs(:,1) + diffvecs(:,2)+1;NumOfDates=max(size(Dates));day = 1;day = num2str(day);day=strcat('0',day);for i = 1:countmonths %looping through months
Date = datestr(Dates(i),'yyyymm'); year = Date(1:4); month = Date(5:6); filename = strcat(ProcessingPath,'3B43.',year,month,day,'.7A.HDF');.....
Best Answer