caldiff
Return calendar differences between adjacent datetime values.
📝Syntax
c = caldiff(t)
c = caldiff(t, components)
c = caldiff(t, components, dim)
📥Input Arguments
Parameter Description
inputs A datetime array, optional component selector, and optional dimension.
📤Output Arguments
Parameter Description
output A calendarDuration array with one fewer element along the selected dimension.
📄Description

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.

💡Examples
Basic usage.
t = [datetime(2024,1,1), datetime(2024,2,1), datetime(2024,4,1)]
c = caldiff(t, 'months')
split(c, 'months')
🔗See Also
datetimeduration
🕔Version History
Version Description
2.0.0 initial version
Edit this page on GitHub