Datsehift function "Shift to Weekday" yields error message
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
JF
le 3 Fév 2022
Réponse apportée : Walter Roberson
le 3 Fév 2022
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 commentaires
Réponse acceptée
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Calendar dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!