How can I easily get for each day in 2013 the type of day? ( Weekday, Saturday, Sunday)
Ältere Kommentare anzeigen
Hello, I want to know if there's an easy way to get to know for each day in 2013 if it was a weekday or a Saturday or Sunday. Since the first day is in 2013 was a Tuesday, the result could be something like:
Year2013=[2 3 4 5 6 7 1 2 3 4...] or [1 1 1 1 2 3 1 1 1 1 1 2 3]...
The result can of course look different, I just want to be able to get a "number" for each day, so that I can go through the year with a loop (1:1:365) and get a number each time. Thanks a lot!
Akzeptierte Antwort
Weitere Antworten (1)
Sean de Wolski
am 10 Mär. 2014
day = weekday(datenum('01/01/2013'):datenum('12/31/2013'))
1 Kommentar
Tim
am 11 Mär. 2014
Kategorien
Mehr zu Calendar finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!