Main Content

Compare Requirement Sets Using Comparison Tool

This example explains different functionalities or features of the Comparison user interface and helps you understand comparison results for different types of properties.

Compare Requirement Sets

The example uses two requirement sets. The file crs_req_func_spec_01 contains the original requirement sets, and the crs_req_func_spec_02 file contains the changed requirements sets.

To compare the two requirements sets, in the current folder pane of MATLAB example, select the two files. Right-click either file and select Compare Selected Files/Folders. Alternatively, use the visdiff function to compare the two sets by typing this command in the MATLAB command prompt.


The two requirement sets now show in the comparison tool.

Understand the Results

By default, the comparison tool shows the differences between the two requirement sets using highlights. The tool differentiates between different types of changes using colors. To change the colors, on the Environment tab on the MATLAB toolstrip, click Preferences, and then click Comparison.

The view in the comparison tool consists of two main parts:

  • The top pane displays the requirement sets in a hierarchical manner.

  • The bottom pane contains a name-value table that displays the names and values of specific properties or key parameters of the selected requirement.

Use the arrow button next to the table to move the table to its corresponding hierarchy pane.

  • When you click a modified requirement on any side, the name-value columns show modification details pertaining to the requirement.

  • When you click on a custom attribute of the requirement set, you can view the changes to the attribute. For example, the requirement set crs_func_spec_02 is modified as true value for Customiization Required? Custom Attributes.

  • When you click Description in the requirements tree, you can view the changes made to the description of the requirements.

Stepping Through Differences

Use the Next and Previous navigation buttons on the Navigate tab of the tool to navigate between groups of changes in the requirement sets. If the item you select on the left has a match, it is selected on the right. Use the Swap Sides button to swap the view.

Highlight Results

To control highlighting in models, on the Highlight tab, select or clear Always Highlight. If you select Always Highlight, the comparison tool will show the corresponding requirements in Requirements Editor each time you select an entry in the comparison tree.

You can click the Highlight Now button to highlight the currently selected requirement at any time in the Requirements Editor. For example, if you select requirement number #67 (Maximum Throttle Value) from crs_req_func_spec_01.slreqx, and click Highlight Now, the requirement opens in the Requirements Editor.

Filter Results

The Show Only Changed option on the Filter tab is always selected. Clear this option to view changed and unchanged requirement sets.

Note: You can follow these steps to compare the link sets file in the comparison. The comparison tool does not compare requirement or link attributes defined or added via stereotypes and profiles.

See Also

Compare Requirement Sets

Compare Link Sets

Related Examples

Three-Way AutoMerge Solution for Requirement Set and Link Set