When a Simulink model contains a Library or Model Reference block, that link is resolved using the MATLAB path. However, when you’re looking at old versions of a model and its dependencies, it’s difficult to know what the path was at the time that these files were saved. DiffPlug addresses this using its library links functionality, which you should read about if you haven’t already.

Things can get a little tricky when two versions of a Model file make references in different ways. In the following example, jaggedTogether is on the left. Each of its major subsystems has been refactored into a separate library in jaggedSplit on the right.

Together vs split

If we double-click the first system, Oven Controller (SubSystem) / (Reference), then the following dialog will appear. On the left, we have the model block. Because it is not a Reference, DiffPlug doesn’t have any questions about its path. But on the right, it turns out that there are 2 different versions of jaggedLib that DiffPlug can find.

Together vs split

There are lots of reasonable comparisons we might want to do.

Together vs split

We can also compare two references to each other.

Together vs split

So on the left, we’ve got two different versions of the Target dynamics block, and on the right we’ve got two different versions of the Oven dynamics block. Drag and drop allows us to compare any of these permutations.

Together vs split