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

    %% Create Sequence of Dates
% Create a sequence of consecutive dates beginning on March 18, 2014.

% Copyright 2015 The MathWorks, Inc.

T = datetime([2014,03,18]) + caldays(0:4)
%%
% Create a sequence of dates beginning on March 18, 2014, spaced 2 days
% apart.
T = datetime([2014,03,18]) + caldays(0:2:8)