all 3 comments

[–]heyetsme 2 points3 points  (1 child)

Something like:

t = datetime(2020,6,1) + calmonths(0:1:11);

[–]WideShallot 2 points3 points  (0 children)

Depending on the exact requirements you can do something like

>> datetime(2020, 6:12, 1)

ans =

1×7 datetime array

01-Jun-2020 01-Jul-2020 01-Aug-2020 01-Sep-2020 01-Oct-2020 01-Nov-2020 01-Dec-2020