ismissing
Class: dataset
(Not Recommended) Find dataset array elements with missing values
The dataset
data type is not recommended. To work with heterogeneous data,
use the MATLAB®
table
data type instead. See MATLAB
table
documentation for more information.
Syntax
I = ismissing(ds)
I = ismissing(ds,Name,Value)
Description
returns a logical array that indicates which elements in the dataset array,
I
= ismissing(ds
)ds
, contain a missing value. By default,
ismissing
recognizes NaN
as a missing value in
numeric variables, ''
as a missing value in character variables, and
<undefined>
as a missing value in categorical arrays.
ds2 = ds(~any(I,2),:)
creates a new dataset array containing only the complete observations inds
.ds2 = ds(:,~any(I,1))
creates a new dataset array containing only the variables fromds
with no missing values.
returns missing value indices with additional options specified by one or more
I
= ismissing(ds
,Name,Value
)Name,Value
pair arguments.
Input Arguments
|
|
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Before R2021a, use commas to separate each name and value, and enclose
Name
in quotes.
|
Vector of numeric values to treat as missing value indicators in
floating point |
|
Character vector, string array, or cell array of character vectors to
treat as missing value indicators in character |
Output Arguments
|
Logical array indicating which elements in |
See Also
dataset
| isempty
| isnan
| isundefined
| replaceWithMissing