d = years(x)
x = years(d)
| Parameter | Description |
|---|---|
| inputs | Numeric year counts or duration arrays. |
| Parameter | Description |
|---|---|
| output | A duration array for numeric input, or double year counts for duration input. |
Create durations from years or convert durations to years.
A year is treated as 365.2425 days for elapsed-time duration conversion. For calendar-year arithmetic, use calyears.
Array-valued inputs keep their data shape when the operation supports arrays. Scalar operands are expanded where the implementation defines scalar expansion.
d = years([1 2])
seconds(d)
years(d)
| Version | Description |
|---|---|
| 2.0.0 | initial version |