calweeks
日历持续时间(以周为单位)
说明
示例
创建日历周数组
X = magic(4); W = calweeks(X)
W = 4x4 calendarDuration
16w 2w 3w 13w
5w 11w 10w 8w
9w 7w 6w 12w
4w 14w 15w 1w
将日历持续时间转换为日历周
创建一个日历持续时间数组。然后,将每个值转换为等效的整数日历周数。
X = caldays(15:17) + hours(1.2345)
X = 1x3 calendarDuration
15d 1h 14m 4.2s 16d 1h 14m 4.2s 17d 1h 14m 4.2s
W = calweeks(X)
W = 1×3
2 2 2
输入参数
X
— 输入数组
数值数组 | 日历持续时间数组 | 逻辑数组
输入数组,指定为数值数组、日历持续时间数组或逻辑数组。如果 X
是数值数组,则它必须仅包含整数值。即,您不能创建带小数的日历单位。
输出参量
W
— 日历周
标量 | 向量 | 矩阵 | 多维数组
日历周,以标量、向量、矩阵或多维数组形式返回。W
的大小与 X
相同。W
的数据类型取决于 X
。
如果
X
为数值数组,则W
是一个日历持续时间数组并且以等效的灵活长度日历周为单位。如果
X
为calendarDuration
数组,则W
是一个由表示整数日历周的整数值组成的double
数组。
扩展功能
tall 数组
对行数太多而无法放入内存的数组进行计算。
此函数完全支持 tall 数组。有关详细信息,请参阅 tall 数组。
基于线程的环境
使用 MATLAB® backgroundPool
在后台运行代码或使用 Parallel Computing Toolbox™ ThreadPool
加快代码运行速度。
分布式数组
使用 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)