Remove missing or incomplete data from an array or a matrix.
Given an input array or matrix A, remove rows or columns with missing data from a matrix, or remove missing data from an array. A can be a numeric or char matrix, a vector or an array of cell strings. R is the return matrix or array, after the removal of missing data.
The values which represent missing data depend on the data type of A:
NaN
: single
, double
.
' '
(white space): char
.
{''}
: string cells.
Choose to remove rows (default) or columns by setting optional input dim:
1
: rows.
2
: columns.
Additional optional parameters are set by Name-Value pairs. These are:
MinNumMissing
: minimum number of missing values to remove an entry,
row or column, defined as a positive integer number. E.g.: if
MinNumMissing
is set to 2
, remove the row of a numeric matrix
only if it includes 2 or more NaN.
Optional return value TF is a logical array where true
values
represent removed entries, rows or columns from the original data A.
See also: ismissing, isnan.
Package: statistics