constructing sequence of dates taking into account the calendar year

조회 수: 1 (최근 30일)
Hi all,
I want to construct a sequence of dates every 28 days. for example
'02/11/08'
'30/11/08'
'28/12/08
I can use the command
cellstr(datestr(datenum({'02/11/08'},'dd/mm/yy')+(0:28:38*28 ),'dd/mm/yy'))
but the problem is that this command does not take int account that some months have 29 days and some others 30 or 31 days. So the clalendar year matters. Any thoughts?thanks
  댓글 수: 2
Oleg Komarov
Oleg Komarov 2012년 5월 24일
It's not clear what you want. Do you want the 28th day of each month?

댓글을 달려면 로그인하십시오.

채택된 답변

Oleg Komarov
Oleg Komarov 2012년 5월 24일
datestr(datenum(2008,11:100,28),'dd/mm/yy')
Adjust the length of the months - 11:100 - to your needs.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Dates and Time에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by