function [monthdays] = dayofyear(nday)
%given dayofyear return month and day as a string
%[monthdays] = dayofyear(nday)
%
%non-leap year 
%days ='jan,feb,mar,apr,may,jun,jul,aug,sep,oct,nov,dec';
 dayv= [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
sum=0;
day=0;
month=0;
%if (fix(year/4)*4 -year ==0) 
%  dayv(2)=29;  % leapyear
%end
  for i=1:12;
    osum=sum;
    sum = sum + dayv(i);
    if ((nday <= sum) & (month ==0));
        month=i;
        day = nday-osum;
    end
end
sprintf('%d %d',month,day);
monthdays = ans;