Next: , Previous: , Up: API Alphabetically   [Contents]

8.2.15 eqn

Function: out = eqn (A, B)

Determine element-wise equality, treating NaNs as equal

out = eqn (A, B)

eqn is just like eq (the function that implements the == operator), except that it considers NaN and NaN-like values to be equal. This is the element-wise equivalent of isequaln.

eqn uses isnanny to test for NaN and NaN-like values, which means that NaNs and NaTs are considered to be NaN-like, and string arrays’ “missing” and categorical objects’ “undefined” values are considered equal, because they are NaN-ish.

Developer’s note: the name “eqn” is a little unfortunate, because “eqn” could also be an abbreviation for “equation”. But this name follows the isequaln pattern of appending an “n” to the corresponding non-NaN-equivocating function.

See also: eq, isequaln, isnanny