function str=dateaxis(jd,base) % function str=dateaxis(jd,base) % converts a sequence of 'jd' julian days into a string % of dates to plot as axis labels. % 'base' is the initial day as [year,month,day] % jd=0 corresponds to the base date str=num2str(zeros(length(jd),1),'%9.9i'); jbase=julian(base(1),base(2),base(3)); jd=jd+jbase-1; ybase=base(1); months=['Jan';'Feb';'Mar';'Apr';'May';'Jun';'Jul';'Aug';'Sep';'Oct';'Nov';'Dec';]; for i=1:length(jd), [m,d]=gregorian(ybase,jd(i)); while(m>12), ybase=ybase+1; jd(i:length(jd))=jd(i:length(jd))-julian(ybase-1,12,31); [m,d]=gregorian(ybase,jd(i)); end sybase=num2str(ybase); str(i,:)=[num2str(d,'%2.2i') '.' months(m,:) '.' sybase(3:4)]; end