c = calyears(x)
| Parameter | Description |
|---|---|
| inputs | Numeric calendar-year counts. |
| Parameter | Description |
|---|---|
| output | A calendarDuration array with year counts stored as months. |
Create calendar durations containing calendar years.
calyears is for calendar arithmetic, not fixed elapsed-time conversion. Adding calyears to a datetime preserves month-end behavior.
Array-valued inputs keep their data shape when the operation supports arrays. Scalar operands are expanded where the implementation defines scalar expansion.
datetime(2024, 2, 29) + calyears(1)
| Version | Description |
|---|---|
| 2.0.0 | initial version |