missing
Return a missing value.
πŸ“Syntax
m = missing()
πŸ“€Output Arguments
Parameter Description
m a missing value for use in arrays and tables
πŸ“„Description
missing returns a special value to represent missing (undefined data). When assigned into an array or table, the missing value is automatically converted into the standard missing value used by the array’s data type.

An indexed assignment such as A(k) = missing or A(:) = missing keeps the class of A: missing becomes NaN in a double or single array, <missing> in a string array, NaN in a duration array and NaT in a datetime array. Arrays of the other classes (char, logical, integer, cell) have no missing value and the assignment raises an error.

Concatenation follows the same rules: [missing missing] is a 1-by-2 missing array, [missing 1] is [NaN 1], [missing []] is NaN, [missing "a"] is a string array, and concatenating missing with a char, logical, integer, cell, struct or function handle value raises an error.

πŸ’‘Examples
A = missing()
A = double([1, 2, missing()])
B = string(["foo", missing()])
C = struct("Name", "Alice", "Age", missing())
S = strings(1, 3);
S(2:3) = missing
X = [1 2 3];
X(:) = missing
M = [missing missing]
πŸ”—See Also
ismissingmissingNaNstring
πŸ•”Version History
Version Description
1.15.0 initial version
Edit this page on GitHub