Monday, August 3, 2009

eomday

End of month

Syntax

  • E = eomday(Y,M)

Description

E = eomday(Y,M) returns the last day of the year and month given by corresponding elements of arrays Y and M.

Examples

Because 1996 is a leap year, the statement eomday(1996,2) returns 29.

To show all the leap years in this century, try:

  • y = 1900:1999;
    E = eomday(y,2*ones(length(y),1)');
    y(find(E==29))'

    ans =
    Columns 1 through 6
    1904 1908 1912 1916 1920 1924

    Columns 7 through 12
    1928 1932 1936 1940 1944 1948

    Columns 13 through 18
    1952 1956 1960 1964 1968 1972

    Columns 19 through 24
    1976 1980 1984 1988 1992 1996

No comments:

Post a Comment