yeardays

Number of days in year

Syntax

Days = yeardays(Year)
Days = yeardays(___,Basis)

Description

example

Days = yeardays(Year) returns the number of days in the given Year.

example

Days = yeardays(___,Basis) returns the number of days in the given Year, based on the optional argument Basis for day-count.

Examples

collapse all

Find the number of days in a given Year.

Days = yeardays(2000)
Days = 366

Find the number of days in a given Year using the optional argument Basis.

Days = yeardays(2000, 1)
Days = 360

Input Arguments

collapse all

Data Types: single | double

Day-count basis, specified as a vector of integers with values 0,1,2,3,4,5,6,7,8,9,10,11,12,13.

  • 0 = actual/actual (default)

  • 1 = 30/360 (SIA)

  • 2 = actual/360

  • 3 = actual/365

  • 4 = 30/360 (BMA)

  • 5 = 30/360 (ISDA)

  • 6 = 30/360 (European)

  • 7 = actual/365 (Japanese)

  • 8 = actual/actual (ICMA)

  • 9 = actual/360 (ICMA)

  • 10 = actual/365 (ICMA)

  • 11 = 30/360E (ICMA)

  • 12 = actual/365 (ISDA)

  • 13 = BUS/252

For more information, see basis.

Data Types: single | double

Output Arguments

collapse all

Number of days in given Year, returned as a nonnegative integer.

Introduced before R2006a