W3cubDocs

/Octave

3.1.2 Missing Data

It is possible to represent missing data explicitly in Octave using NA (short for “Not Available”). Missing data can only be represented when data is represented as floating point numbers. In this case missing data is represented as a special case of the representation of NaN.

NA
NA (n)
NA (n, m)
NA (n, m, k, …)
NA (…, class)

Return a scalar, matrix, or N-dimensional array whose elements are all equal to the special constant used to designate missing values.

Note that NA always compares not equal to NA (NA != NA). To find NA values, use the isna function.

When called with no arguments, return a scalar with the value ‘NA’.

When called with a single argument, return a square matrix with the dimension specified.

When called with more than one scalar argument the first two arguments are taken as the number of rows and columns and any further arguments specify additional matrix dimensions.

The optional argument class specifies the return type and may be either "double" or "single".

See also: isna.

isna (x)

Return a logical array which is true where the elements of x are NA (missing) values and false where they are not.

For example:

isna ([13, Inf, NA, NaN])
     ⇒ [ 0, 0, 1, 0 ]

See also: isnan, isinf, isfinite.

© 1996–2018 John W. Eaton
Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies.
Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions.
https://octave.org/doc/interpreter/Missing-Data.html