ismissing
Find missing values
Description
TF = ismissing( returns a logical array that
indicates which elements of the input data contain missing values. The size of
A)TF is the same as the size of A.
Missing values are defined according to the data type of
A:
NaN—double,single,duration, andcalendarDurationNaT—datetime<missing>—string<undefined>—categorical{''}—cellof character vectors
If A is a table, then the data type of each variable defines the
missing value for that variable.
For data types with no default definition of a standard missing value,
ismissing(A) returns an array or table of logical 0
(false) values the same size as A.
You can use ismissing functionality interactively by adding the
Clean Missing
Data task to a live script.
TF = ismissing(
treats the values in A,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, if A is an array of
type double, then ismissing(A,[0,-99]) treats 0 and
–99 as missing double values instead of NaN.
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, use a special integer value (otherwise unused) to indicate missing integer data, such as-99.For more information on finding missing strings, see Test for Empty Strings and Missing Values.
For input data that is a structure array or a cell array of non-character vectors,
ismissingreturnsfalse. To find missing values in a structure array, applyismissingto each field in the structure by using thestructfunfunction. To find missing values in a cell array of non-character vectors, applyismissingto each cell in the cell array by using thecellfunfunction.
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,
ismissingdoes not ignore indicator white space. All character vectors must match exactly.For character arrays in table variables,
ismissingignores trailing white space in the indicator.For categorical arrays,
ismissingignores leading and trailing white space in the indicator.
Alternative Functionality
Live Editor Task
You can use ismissing functionality interactively by adding the
Clean Missing
Data task to a live script.

Extended Capabilities
Version History
Introduced in R2013bSee Also
Functions
isoutlier|standardizeMissing|anymissing|rmmissing|fillmissing|fillmissing2|missing|isnan|isempty|isundefined|any|all