Datsehift function "Shift to Weekday" yields error message

The following code provided by MathWorks does not work
t = [datetime(2021,5,30) datetime(2021,6,4)];
t.Format='eeee, dd MMM yyyy'
t2 = dateshift(t,'dayofweek','weekday')
I obtain the following error message:
Error using datetime/dateshift (line 151)
Day of week must be a number from 1 to 7, or a day name. Any idea why this error occurs?

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Calendar에 대해 자세히 알아보기

제품

릴리스

R2020a

질문:

JF
2022년 2월 3일

답변:

2022년 2월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by