%% Line Plot with Durations
% Create a line plot with duration values on the x-axis. Then, change the format of the tick labels and the x-axis limits.
% Create t as seven linearly spaced duration values between 0 and 3 minutes. Create y as a vector of random data. Plot the data.

t = 0:seconds(30):minutes(3);
y = rand(1,7);
plot(t,y);

%
% View the x-axis limits. Since the duration tick labels are in terms of a single unit (minutes), the limits are stored in terms of that unit.

xl = xlim

%
% Change the format for the duration tick labels to display in the form of a digital timer that includes more than one unit. For a list of formatting options, see the xtickformat function.

xtickformat('mm:ss')

%
% View the x-axis limits again. Since the duration tick labels are now in terms of multiple units, the limits are stored in units of 24-hour days.

xl = xlim

% Copyright 2012 The MathWorks, Inc.