Hi Reuben,
It seems you're facing an issue with the "setdiff" function when comparing "Simulink.VariableUsage" objects. The function should ideally return variables that are in "VarsIn1" but not in "VarsIn2," based on the "Name," "Source," and "SourceType" properties. If "setdiff" is returning all variables from "VarsIn1," it suggests that it's not finding a match in "VarsIn2" for those variables, even though you have manually confirmed that they should match.
This could be due to several reasons, such as small differences in the properties of the objects that aren't properly visible or an issue with the data type or format of the properties.
To debug this, I believe that you have to manually check and compare the properties of a few "Simulink.VariableUsage" objects from both "VarsIn1" and "VarsIn2" to confirm they are exactly the same.