Main Content

calendar

Calendar for specified month

Syntax

c = calendar
c = calendar(d)
c = calendar(y, m)

Description

c = calendarreturns a 6-by-7 matrix containing a calendar for the current month. The calendar runs Sunday (first column) to Saturday.

c = calendar(d), whered是一个数字或文本代表dat连环约会吗e and time, returns a calendar for the specified month.

c = calendar(y, m), whereyandmare integers, returns a calendar for the specified month of the specified year.

If you do not specify an output argument, thencalendardisplays a calendar in the Command Window but does not return a value.

Examples

The command

calendar(1957,10)

reveals that the Space Age began on a Friday (on October 4, 1957, when Sputnik 1 was launched).

Oct 1957 S M Tu W Th F S 0 0 1 2 345 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 0 0 0 0 0 0 0 0 0

Limitations

  • MATLAB®Online™determines the current month from Coordinated Universal Time (UTC) rather than from local time.

Version History

Introduced before R2006a

See Also