c = caldiff(t)
c = caldiff(t, components)
c = caldiff(t, components, dim)
| Parameter | Description |
|---|---|
| inputs | A datetime array, optional component selector, and optional dimension. |
| Parameter | Description |
|---|---|
| output | A calendarDuration array with one fewer element along the selected dimension. |
Return calendar differences between adjacent datetime values.
caldiff computes pairwise adjacent differences by delegating each interval to between.
Array-valued inputs keep their data shape when the operation supports arrays. Scalar operands are expanded where the implementation defines scalar expansion.
t = [datetime(2024,1,1), datetime(2024,2,1), datetime(2024,4,1)]
c = caldiff(t, 'months')
split(c, 'months')
| Version | Description |
|---|---|
| 2.0.0 | initial version |