Main Content

isFilteredIn

Class: slreq.Requirement
Package: slreq

Check filtered requirements

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'
     ReqFilter: "{'ReqType','Container'};"
    LinkFilter: ''
          Host: ''

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

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

Clear the loaded requirement sets and close the Requirements Editor.

slreq.clear;

Tips

Version History

Introduced in R2022b