try this is code
t = datenum('2008-04-17 02:00'):datenum('2009-11-24 12:27');
data = randi(150,numel(t),1);
DOY = t(:) - datenum(year(t(:)),0,1);
plot(t,data);
set(gca,'XTick',floor(t(1:50:end))','XTickLabel',floor(DOY(1:50:end)))
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!