isnat - Determine NaT (Not-a-Time) elements - MATLAB (original) (raw)

Main Content

Determine NaT (Not-a-Time) elements

Syntax

Description

tf = isnat([A](#bujxtex-1-A)) returns an array the same size as the datetime array, A, containing logical 1 (true) where the elements of A are Not-a-Time (NaTs) and logical 0 (false) where they are not. NaT represents a datetime that is undefined.

example

Examples

collapse all

Create a datetime array from numeric values containing NaN.

d = datetime(2014,[1 2 NaN 4],1)

d = 1×4 datetime 01-Jan-2014 01-Feb-2014 NaT 01-Apr-2014

Determine if any elements of d are NaT (Not-a-Time).

ans = 1×4 logical array

0 0 1 0

Input Arguments

collapse all

Input array, specified as a datetime array.

Extended Capabilities

expand all

Theisnat function fully supports tall arrays. For more information, see Tall Arrays.

Version History

Introduced in R2014b