Why does comparison tool show modification when the values look the same?
I’m comparing two .mat files, each containing a 2D matrix (2416 x 843) which should be identical. The left one is generated by a MATLAB script and weighs 585 KB. The right one by a Python script and weighs 550 KB. The MATLAB comparison tool highlights some values (including all NaNs, by the looks of it) as modified, though they appear to be the same (see screenshot). This only seems to happen above a certain volume of data (each value in this matrix represents the average of 9 values; the issue does not occur for averages of 8 values or fewer). This does not happen with any other files/variables in this workflow.
Does anyone have any ideas why this might be happening?
Edit to add: I have also tried loading these two variables in the command window and compare them in a few different ways (examples below), all of which seem to suggest that MATLAB identifies them as equal.
>> sum(meanSampleAge – py_meanSampleAge, "all", "omitnan")
ans =
0
>> py_meanSampleAge(1642, 550) == meanSampleAge(1642, 550) % highlighted cell in the image above, same for others
ans =
logical
1I’m comparing two .mat files, each containing a 2D matrix (2416 x 843) which should be identical. The left one is generated by a MATLAB script and weighs 585 KB. The right one by a Python script and weighs 550 KB. The MATLAB comparison tool highlights some values (including all NaNs, by the looks of it) as modified, though they appear to be the same (see screenshot). This only seems to happen above a certain volume of data (each value in this matrix represents the average of 9 values; the issue does not occur for averages of 8 values or fewer). This does not happen with any other files/variables in this workflow.
Does anyone have any ideas why this might be happening?
Edit to add: I have also tried loading these two variables in the command window and compare them in a few different ways (examples below), all of which seem to suggest that MATLAB identifies them as equal.
>> sum(meanSampleAge – py_meanSampleAge, "all", "omitnan")
ans =
0
>> py_meanSampleAge(1642, 550) == meanSampleAge(1642, 550) % highlighted cell in the image above, same for others
ans =
logical
1 I’m comparing two .mat files, each containing a 2D matrix (2416 x 843) which should be identical. The left one is generated by a MATLAB script and weighs 585 KB. The right one by a Python script and weighs 550 KB. The MATLAB comparison tool highlights some values (including all NaNs, by the looks of it) as modified, though they appear to be the same (see screenshot). This only seems to happen above a certain volume of data (each value in this matrix represents the average of 9 values; the issue does not occur for averages of 8 values or fewer). This does not happen with any other files/variables in this workflow.
Does anyone have any ideas why this might be happening?
Edit to add: I have also tried loading these two variables in the command window and compare them in a few different ways (examples below), all of which seem to suggest that MATLAB identifies them as equal.
>> sum(meanSampleAge – py_meanSampleAge, "all", "omitnan")
ans =
0
>> py_meanSampleAge(1642, 550) == meanSampleAge(1642, 550) % highlighted cell in the image above, same for others
ans =
logical
1 comparison, python, data MATLAB Answers — New Questions