MATLAB Answers

How to create a single array with datetime range?

3 views (last 30 days)
Hello everyone
I want to create a single array (408 x 1) that filled monthly from 1982-01-01 to 2015-12-01.
like below:
1982-01-01
1982-02-01
1982-03-01
1982-04-01
.
.
.
2015-12-01
Thank you for any help you can provide.

  0 Comments

Sign in to comment.

Accepted Answer

Sebastian Bomberg
Sebastian Bomberg on 29 Oct 2019
d = datetime(1982,1,1):calmonths(1):datetime(2015,12,1);
See also this doc page.

  0 Comments

Sign in to comment.

More Answers (0)

Sign in to answer this question.