Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

isweekend

Determine weekend elements

Syntax

tf = isweekend(t)

Description

example

tf = isweekend(t) returns an array the same size as t containing logical 1 (true) where the corresponding element of t is a datetime that occurs on a weekend day, and logical 0 (false) otherwise. Weekend days are Saturday and Sunday.

Examples

collapse all

t = datetime(2014,5,2:5,'Format','eee dd-MMM-yyyy')
t = 1x4 datetime array
   Fri 02-May-2014   Sat 03-May-2014   Sun 04-May-2014   Mon 05-May-2014

tf = isweekend(t)
tf = 1x4 logical array
   0   1   1   0

May 3 and May 4, 2014 are days that fall on a weekend.

Input Arguments

collapse all

Input date and time, specified as a datetime array.

Extended Capabilities

See Also

|

Introduced in R2014b

Was this topic helpful?