%% Set Limits for x-Axis with Dates
% Create a stem chart with dates along the x-axis. Set the x-axis limits to range from June 1, 2014 to June 5, 2014.

t = datetime(2014,06,1) + caldays(0:10);
y = rand(11,1);
stem(t,y,'filled')

tstart = datetime(2014,06,1);
tend = datetime(2014,06,5);
xlim([tstart tend])

%
% Copyright 2012 The MathWorks, Inc.