week
日期时间输入的周数值
说明
示例
输入参数
t
— 日期时间输入
datetime
数组
日期时间输入,指定为 datetime
数组。
weekType
— 周值的类型
'weekofyear'
(默认) | 'weekofmonth'
周值的类型,指定为 'weekofyear'
或 'weekofmonth'
。
如果
weekType
为'weekofyear'
,则week
返回表示一年中第几周的数值。第 1 周是 1 月 1 日所处的周,即使该周有不到 4 天属于同一年中也如此。如果
weekType
为'weekofmonth'
,则week
返回表示一个月中第几周的数值。一个月中的第 1 周定义为该月的第一天所处的周,即使该周有不到 4 天处于同一月中也如此。
扩展功能
tall 数组
对行数太多而无法放入内存的数组进行计算。
此函数完全支持 tall 数组。有关详细信息,请参阅 tall 数组。
基于线程的环境
使用 MATLAB® backgroundPool
在后台运行代码或使用 Parallel Computing Toolbox™ ThreadPool
加快代码运行速度。
此函数完全支持基于线程的环境。有关详细信息,请参阅Run MATLAB Functions in Thread-Based Environment。
分布式数组
使用 Parallel Computing Toolbox™ 在集群的组合内存中对大型数组进行分区。
此函数完全支持分布式数组。有关详细信息,请参阅Run MATLAB Functions with Distributed Arrays (Parallel Computing Toolbox)。
版本历史记录
在 R2014b 中推出
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 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)