www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/SpecifyDurationTickFormatsExample.m

    %% Plot Durations and Specify Tick Format
%%
% Define |t| as seven linearly spaced |duration| values between 0 and 3
% minutes. Plot random data and specify the format of the |duration| tick
% marks using the |'DurationTickFormat'| name-value pair argument.

% Copyright 2015 The MathWorks, Inc.

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

plot(t,y,'DurationTickFormat','mm:ss')