|MATLAB Function Reference|
Determine if arrays are numerically equal, treating
NaNs as equal
tf = isequalwithequalnans(A,B,...)
returns logical true (
1) if the input arrays are the same type and size and hold the same contents, and logical false (
NaN (Not a Number) values are considered to be equal to each other. Numeric data types and structure field order do not have to match.
isequalwithequalnans is the same as
NaN (Not a Number) values to be equal, and
isequal does not.
isequalwithequalnans recursively compares the contents of cell arrays and structures. If all the elements of a cell array or structure are numerically equal,
isequalwithequalnans returns logical
NaNs are handled differently by
isequal does not consider
NaNs to be equal, while
The position of
NaN elements in the array does matter. If they are not in the same position in the arrays being compared, then
isequalwithequalnans returns zero.
isa, is*, relational operators