Help Center
Determine NaT (Not-a-Time) elements
tf = isnat(A)
tf = isnat(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.
A
true
NaT
false
example
collapse all
Create a datetime array from numeric values containing NaN.
NaN
d = datetime(2014,[1 2 NaN 4],1)
d = 1x4 datetime 01-Jan-2014 01-Feb-2014 NaT 01-Apr-2014
Determine if any elements of d are NaT (Not-a-Time).
d
isnat(d)
ans = 1x4 logical array 0 0 1 0
Input array, specified as a datetime array.
The isnat function fully supports tall arrays. For more information, see Tall Arrays.
isnat
backgroundPool
ThreadPool
This function fully supports thread-based environments. For more information, see Run MATLAB Functions in Thread-Based Environment.
This function fully supports distributed arrays. For more information, see Run MATLAB Functions with Distributed Arrays (Parallel Computing Toolbox).
Introduced in R2014b
ismissing | isinf | isfinite
ismissing
isinf
isfinite
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other bat365 country sites are not optimized for visits from your location.
Americas
Europe
Asia Pacific
Contact your local office