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

    %% Create Sequence of Dates Falling on Specific Day of Week
% Generate a sequence of dates consisting of the next three occurrences of
% Friday.

% Copyright 2015 The MathWorks, Inc.

t = datetime('today')
%%
t2 = dateshift(t,'dayofweek','Friday',1:3)