MATLAB Functions Help Desk

weekday

Purpose

Day of the week

Syntax

Description

[N,S] = weekday(D) returns the day of the week in numeric (N) and string (S) form for each element of a serial date number array or date string. The days of the week are assigned these numbers and abbreviations:

N

S

N

S

1

Sun

5

Thu

2

Mon

6

Fri

3

Tue

7

Sat

4

Wed

Examples

Either

or

returns n = 2 and s = Mon.

See Also

datenum     Serial date number

datevec     Date components

eomday      End of month



[ Previous | Help Desk | Next ]