ismissing
Find missing values
Description
TF = ismissing(
returns a logical array that indicates which elements of the input data contain missing values. The size ofA
)TF
is the same as the size ofA
.
Missing values are defined according to the data type ofA
:
NaN
—double
,single
,duration
, andcalendarDuration
NaT
—datetime
—string
—categorical
' '
—char
{''}
—cell
of character vectors
IfA
is a table, then the data type of each column defines the missing value for that column.
For data types with no default definition of a standard missing value,ismissing(A)
returns an array or table of logical0
(false
) values the same size asA
.
TF = ismissing(
treats the values inA
,indicator
)indicator
as missing value indicators, ignoring all default indicators listed in the previous syntax.indicator
can be a single indicator or multiple indicators. For example, ifA
is an array of typedouble
, thenismissing(A,[0,-99])
treats 0 and –99 as missingdouble
values instead ofNaN
.
specifies for table or timetable input data the output data type for any of the previous syntaxes.TF
= ismissing(___'OutputFormat',format
)
Examples
Input Arguments
Tips
Because integer variables cannot store
NaN
,使用一个特殊的整数值(否则未使用)to indicate missing integer data, such as-99
.For more information on finding missing strings, seeTest for Empty Strings and Missing Values.
Algorithms
ismissing
handles leading and trailing white space differently for indicators that are cell arrays of character vectors, character arrays, or categorical arrays.
For cell arrays of character vectors,
ismissing
does not ignore indicator white space. All character vectors must match exactly.For character arrays in table variables,
ismissing
ignores trailing white space in the indicator.For categorical arrays,
ismissing
ignores leading and trailing white space in the indicator.
Extended Capabilities
Version History
Introduced in R2013bSee Also
Functions
isoutlier
|standardizeMissing
|anymissing
|rmmissing
|fillmissing
|missing
|isnan
|isempty
|isundefined
|any
|all