Day = ww2day(Dat)
Day = ww2day(Dat,WDay)
Dat
[ numeric ] - IRIS serial number for weekly date.
WDay
[ 'Mon'
| 'Tue'
| 'Wed'
| 'Thu'
| 'Fri'
| 'Sat'
| 'Sun'
] - The day of the week that will represent the input week, Dat
; if omitted, the week will be represented by its Thursday.
Day
[ numeric ] - Matlab serial date number representing Thursday in that week.The first week of the year 2009 starts on Monday, 29 December 2008 (it is the first week of 2009 by ISO 8601 definition, because Thursday of that week falls in 2009).
The following command returns the Thursday of that week (note that datestr
is a standard Matlab function, not an IRIS function),
firstWeek09 = ww(2009,1);
datestr( ww2day(firstWeek09) )
ans =
01-Jan-2009
while this command returns the Monday of the same week,
datestr( ww2day(firstWeek09,'Monday') )
ans =
29-Dec-2008