Main Content

Fill missing values

fills
missing entries of an array or table with the constant value `F`

= fillmissing(`A`

,'constant',`v`

)`v`

.
If `A`

is a matrix or multidimensional array, then `v`

can
be either a scalar or a vector. When `v`

is a vector,
each element specifies the fill value in the corresponding column
of `A`

. If `A`

is a table or timetable,
then `v`

can also be a cell array.

Missing values are defined according to the data type of `A`

:

`NaN`

—`double`

,`single`

,`duration`

, and`calendarDuration`

`NaT`

—`datetime`

`<missing>`

—`string`

`<undefined>`

—`categorical`

`' '`

—`char`

`{''}`

—`cell`

of character arrays

If `A`

is a table, then the data type of each
column defines the missing value for that column.

specifies
additional parameters for filling missing values using one or more
name-value pair arguments. For example, if `F`

= fillmissing(___,`Name,Value`

)`t`

is
a vector of time values, then `fillmissing(A,'linear','SamplePoints',t)`

interpolates
the data in `A`

relative to the times in `t`

.

Clean Missing
Data | `filloutliers`

| `ismissing`

| `isnan`

| `missing`

| `rmmissing`

| `standardizeMissing`