calyears
Calendar duration in years
Syntax
Description
returns
an array representing calendar years equivalent to the values in Y
= calyears(X
)X
.
Calendar years account for leap days when used in calendar calculations.
If
X
is a numeric array, thenY
is acalendarDuration
array with each element equal to the number of calendar years in the corresponding element ofX
.If
X
is acalendarDuration
array, thencalyears
returns the number of whole years equivalent to each calendar duration inX
.
Examples
Input Arguments
Output Arguments
Tips
calyears
creates years that account for leap days when used in calendar calculations. To create exact fixed-length (365.2425 day) years, use theyears
function.
Extended Capabilities
Version History
Introduced in R2014b