Main Content

isFilteredIn

Class: slreq.Requirement
Namespace: slreq

Check filtered requirements

Since R2022b

Syntax

tf = isFilteredIn(req)

Description

tf = isFilteredIn(req) checks if the requirement, req, is filtered in the Requirements Editor or Requirements Perspective and returns 1 if the requirement is not filtered and 0 if the requirements is filtered.

Input Arguments

expand all

Requirement, specified as an slreq.Requirement object.

Examples

expand all

This example shows how to check if a requirement is filtered.

Load the myAddRequirements requirement set.

rs = slreq.open("myAddRequirements");

Find the requirement with Summary set to Input u.

req = find(rs,Summary="Input u");

Check if the requirement is filtered.

tf = isFilteredIn(req)
tf = logical
   1

Create a filter called ContainerReqs. Use the ReqFilter property to define a filter that displays only requirements with Type set to Container.

myView = slreq.View.create("ContainerReqs");
myView.ReqFilter = "{'ReqType','Container'};"
myView = 
  View with properties:

          Name: 'ContainerReqs_0_1'
     ReqFilter: '{'ReqType','Container'};'
    LinkFilter: ''
          Host: ''

Apply the filter, then check if the requirement is filtered.

activate(myView)
tf = isFilteredIn(req)
tf = logical
   0

Tips

  • To check if a referenced requirement is filtered, use the isFilteredIn method of slreq.Reference. To check if a justification is filtered, use the isFilteredIn method of slreq.Justification. To check if a link is filtered, use the isFilteredIn method of slreq.Link.

Version History

Introduced in R2022b