Saturday, November 2, 2013

Find the number of days in given year range



% Find Number of days in an year
% This needed for finding indices to process
clc
countindices1 = 1
year = 2005;
countdays = 0;
while year<= 2010
   disp(['year', num2str(year)]) 
    countdays = countdays+yeardays(year);

    disp(['starts@', num2str(countindices1)])
        disp(['ends@', num2str(countdays)])
        array= [countindices1:countdays];
        whos array
    disp('%%%%%')
    
    countindices1 = countdays+1;
    
         year = year+1;
disp(['totaldays = ',num2str(countdays)])
end


No comments: