w = week(t) returns the week-of-year
numbers of the datetime values in t. The m
output is a double array the same size as t
and contains integer values from 1 to 53.
w = week(t,weekType)
returns the type of week number specified by weekType.
Input date and time, specified as a datetime array.
weekType — Type of week values 'weekofyear' (default) | 'weekofmonth'
Type of week values, specified as either 'weekofyear'
or 'weekofmonth'.
If weekType is
'weekofyear', then
month returns the week-of-year number.
Week 1 is the week in which January 1 falls, even if fewer than
4 days of that week fall in the same year.
If weekType is
'weekofmonth', then
month returns the week-of-month number.
Week 1 in a month is defined as the week in which the first day
of the month falls, even if fewer than 4 days of that week fall
in the same month.
Extended Capabilities
Tall Arrays Calculate with arrays that have more rows than fit in memory.
This function fully supports tall arrays. For
more information, see Tall Arrays.
Distributed Arrays Partition large arrays across the combined memory of your cluster using Parallel Computing Toolbox™.