Datsehift function "Shift to Weekday" yields error message

2 ビュー (過去 30 日間)
JF
JF 2022 年 2 月 3 日
回答済み: Walter Roberson 2022 年 2 月 3 日
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?

採用された回答

Walter Roberson
Walter Roberson 2022 年 2 月 3 日

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCalendar についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by