Main Content

Compare SimBiology Models

You can compare two SimBiology models and generate a list of differences between them. If the models contain diagram (graphical) information, the comparison results also include differences for the model diagrams. For details on how SimBiology compares and matches model components, see SimBiology Model Matching Policy.

Compare Models Programmatically

Use sbiodiff at the command line. It returns a SimBiology.DiffResults object that contains the comparison results.

Compare Models Graphically

To view the comparison results graphically in the Comparison tool, do one of the following:

  • At the command line, call visdiff(diffResults), where diffResults is the SimBiology.DiffResults object returned by sbiodiff.

  • At the command line, call visdiff with two SBPROJ files as inputs.

  • On the Home tab of the MATLAB® desktop, click Compare and select two SBPROJ files.

  • Select two SBPROJ files in the Current Folder panel of the MATLAB desktop. Right-click and select Compare Selected Files/Folders.

The next figure shows an example of the Comparison tool comparing two models side by side. It uses different colors to indicate the insertion, deletion, and modification of model components. The tool lists the components in the order that they appear in the corresponding model.

Comparison tool showing the differences between two models side by side

The Previous and Next buttons in the toolstrip let you step through each difference. Use the Filter menu to customize the comparison results. The middle section of the app contains the tree of the matched model components. The bottom section shows the property values of the model components selected in the middle section.

By default, the tool hides the unchanged properties, dependent changes, and unchanged components. The Filter menu gives additional criteria to fine-tune the results. For example, you can hide the quantity-based components (compartment, species, and parameters), the expression-based components (reactions, rules, events, and observables), and graphical changes.

Note

The dependent changes are the side effects of changing the Name, Parent, or Owner properties of a quantity component. When these properties change, they trigger changes in other components referencing the quantity component. For instance, the Reaction property of a reaction C1.S1 -> C1.S2 changes to C1.S3 -> C1.S2 when you rename the species S1 residing in a compartment C1 to S3. The app hides such dependent changes by default.

Filter menu of the tool is shown

Git Integration

You can compare different versions of SBPROJ files that you have in a Git repository from within MATLAB as shown next. For details on setting up a Git repository, see Use Git in MATLAB.

See Also

|

Related Topics