Determine leap year
Determine whether 2005 is a leap year.
ly = leapyear(2005)
ly = logical 0
Determine if 2000, 2005, and 2020 are leap years.
ly = leapyear([2000 2005 2020])
ly = 1×3 logical array 1 0 1
Year to be evaluated, specified as an array or scalar. The function floors non-integer values to the nearest integer value.
leapyear— Leap year determination
Leap year determination, returned as a scalar or array as a logical value.
The determination of leap years is done by Gregorian calendar rules.