duration

Methods

Method Reference: duration.years

duration: X = years (D)

Duration equivalent numeric values in fixed-length years.

X = years (D) converts durations in D to the equivalent number of fixed-length years (1 year equals 365.2425 days). X is a double array of the same size as D.

Source Code: duration

Example: 1

As a duration method, years returns the duration expressed in fixed-length years (365.2425 days).

 d = days (365.2425)
d =
  duration

   365.243 days
 years (d)
ans = 1