Configure Views in the Requirements Editor
You can choose which requirements and links to display in the Requirements Editor and Requirements Perspective by creating a view that filters based on requirement and link metadata. You can also choose which requirement properties and custom attributes to display by configuring the displayed columns, which the software saves in the view. You can share views with other users by using a MAT-file or a requirement set that has views stored internally.
Create Views
To create a view:
Open the Filtered View Editor:
In the Requirements Editor, select Filter View > Manage Views.
In the Requirements Perspective, click the Select View menu and select
Manage Views
.
In the Filtered View Editor, click New. Enter a name in the View name field.
To store the view in the preferences folder, set Storage type to
User
. For more information, see Where MATLAB Stores Preferences. To store the view in a requirement set, select the requirement set from the list next to Storage type. You cannot store a view in a link set.Note
When you store a view in a the requirement set, changes to the view do not cause the requirement set to have unsaved changes.
In the Requirements Filter and Links Filter tabs, define your filter criteria, then click OK. If you stored a view in the requirement set, save the requirement set.
When you apply the view and then add and remove columns in the Requirements Editor, Requirements Toolbox™ saves the column layout in the view. For more information, see Apply Views.
Alternatively, you can save the current column layout and applied filters as a new view:
In the Requirements Editor, select Filter View > Save View.
In the Requirements Perspective, click the Select View menu and select
Save View
.
In the Save View dialog, enter a name for the view and click OK. You can also overwrite an existing view by selecting it from the list.
Create Views Programmatically
To create a view programmatically, use the create
function.
Define Requirement and Link Filters
To define filter criteria in the Filtered View Editor, enter a cell array of
comma-separated name-value arguments with the same input syntax as slreq.find
. For example, to display only the requirements with
Type
set to Functional
, use this filter:
{"ReqType","Functional"};
Tip
To define a filter that displays objects that meet at least one of multiple
specified criteria, separate the specified criteria with "-or"
.
For example, to display the requirements with Type
set to
Functional
or with Type
set to
Informational
, use this
filter:
{"ReqType","Functional","-or","ReqType","Informational"};
Requirement filters apply to all loaded requirements, referenced requirements, and justifications. Link filters apply to all loaded links.
Define Filters Programmatically
To define filters programmatically, set the ReqFilter
and LinkFilter
properties of the slreq.View
object. Enter the filter as a string scalar or character
array that contains a cell array of comma-separated name-value arguments with the
same input syntax as slreq.find
.
For example, consider an slreq.View
object that is assigned to a variable called
myView
. To display only the requirements with
Type
set to Functional
,
enter:
myView.ReqFilter = "{'ReqType','Functional'};";
Apply Views
To apply a view in the Requirements Editor, click Filter View , then select a view from the list. To reset the view to the default view, select Default view.
To apply a view in the Requirements Perspective, click the Select View menu and select a view from the list.
When you add and remove columns in the Requirements Editor, Requirements Toolbox saves the column layout in the view. For more information about adding and removing columns, see Display Additional Columns.
Apply Views Programmatically
To apply a view programmatically, use activate
. To reset the view to the default view, use activateDefaultView
.
Manage Views
To edit or delete a view, open the Filtered View Editor:
In the Requirements Editor, select Filter View > Manage Views.
In the Requirements Perspective, click the Select View menu and select
Manage Views
.
To edit a view, select the view and edit the name or filter criteria. You cannot edit the storage location.
To delete a view, select the view and click Delete.
Manage Views Programmatically
To edit a view programmatically, edit the Name
, ReqFilter
, or LinkFilter
properties of the slreq.View
object.
To delete a view programmatically, use delete
.
Share Views
To share views with other users, you can share a:
Requirement set that has views stored in the set
User preferences MAT-file
Requirements Toolbox view settings MAT-file
To share a view stored in a requirement set, share the SLREQX file.
To share your views stored in your preferences folder, identify the location of your
preferences folder by using prefdir
. For more information, see
Where MATLAB Stores Preferences. Share the
MAT-file called slreqViewSettings_v2.mat
. Other users can place this
file in their preferences folder to use the views.
To share a Requirements Toolbox view settings as a MAT-file, use slreq.exportViewSettings
to export the currently loaded views. To import
the MAT-file, use slreq.importViewSettings
. The views are saved where they were originally
stored.