calyears
Calendar duration in years
Syntax
Description
The calyears function returns an array that represents
calendar years. When you use arrays that have the calendarDuration
data type in calendar calculations, the calculations take into account leap years,
Daylight Saving Time shifts, and the differing lengths of calendar months. To create
exact fixed-length years instead, use the years function. A fixed-length year is 365.2425 days
long.
returns an
array representing calendar years equivalent to the values in
Y = calyears(X)X.
If
Xis a numeric array, thenYis acalendarDurationarray with each element equal to the number of calendar years in the corresponding element ofX.If
Xis acalendarDurationarray, thencalyearsreturns the number of whole years equivalent to each calendar duration inX.
Examples
Input Arguments
Output Arguments
Tips
calyearscreates years that account for leap days when used in calendar calculations. To create exact fixed-length (365.2425 day) years, use theyearsfunction.
Extended Capabilities
Version History
Introduced in R2014b