function bdate = YrToDate(year,n) % YrToDate converrt fractional year to [yr month day .. to n] % if n > 6 , n=6; end yr = fix(year); fyr = mod(year,1); if mod(yr,4) == 0 doy = fyr*366 + 1; else doy = fyr*365 + 1; end ser = datenum(yr,1,doy); bdfull = datevec(ser); bdate = bdfull(:,1:n)';