week
Week number of input date and time
Description
Examples
Find Week of Year Numbers of Dates
t = datetime(2013,05,31):calmonths(3):datetime(2014,06,15)
t = 1x5 datetime
31-May-2013 31-Aug-2013 30-Nov-2013 28-Feb-2014 31-May-2014
w = week(t)
w = 1×5
22 35 48 9 22
Input Arguments
t
— Input date and time
datetime
array
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'
, thenweek
returns the week-of-year number. Week 1 is the week in which January 1 falls, even if fewer than four days of that week fall in the same year.If
weekType
is'weekofmonth'
, thenweek
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 four 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.
Thread-Based Environment
Run code in the background using MATLAB® backgroundPool
or accelerate code with Parallel Computing Toolbox™ ThreadPool
.
This function fully supports thread-based environments. For more information, see Run MATLAB Functions in Thread-Based Environment.
Distributed Arrays
Partition large arrays across the combined memory of your cluster using Parallel Computing Toolbox™.
This function fully supports distributed arrays. For more information, see Run MATLAB Functions with Distributed Arrays (Parallel Computing Toolbox).
Version History
Introduced in R2014b
Abrir ejemplo
Tiene una versión modificada de este ejemplo. ¿Desea abrir este ejemplo con sus modificaciones?
Comando de MATLAB
Ha hecho clic en un enlace que corresponde a este comando de MATLAB:
Ejecute el comando introduciéndolo en la ventana de comandos de MATLAB. Los navegadores web no admiten comandos de MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)