Skip to content

isequalwithequalnans

Like isequal, but treats NaNs as equal to other NaNs.

tf = isequalwithequalnans(A, B)
tf = isequalwithequalnans(A, B, C, ...)

Same semantics as isequal except that NaN values are considered equal to other NaN values at corresponding positions. Useful when comparing data sets that include missing-value sentinels.

isequalwithequalnans([1 NaN 3], [1 NaN 3]) % 1
isequal([1 NaN 3], [1 NaN 3]) % 0
  • isequal — Test whether two or more inputs are equal in shape and value.