Main Content

isFilteredIn

Class: slreq.Link
Namespace: slreq

Check filtered links

Since R2022b

Syntax

tf = isFilteredIn(myLink)

Description

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

Input Arguments

expand all

Link, specified as an slreq.Link object.

Examples

expand all

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

Load the myAddRequirements requirement set, which also loads the myAdd link set.

rs = slreq.open("myAddRequirements");

Find the myAdd link set.

ls = slreq.find(Type="LinkSet",Description="myAdd");

Get the first link in the link set.

linksArray = getLinks(ls);
myLink = linksArray(1);

Check if the link is filtered.

tf = isFilteredIn(myLink)
tf = logical
   1

Create a filter called ImplementLinks. Use the LinkFilter property to define a filter that displays only links with Type set to Implement.

myView = slreq.View.create("ImplementLinks");
myView.LinkFilter = "{'LinkType','Implement'};"
myView = 
  View with properties:

          Name: 'ImplementLinks'
     ReqFilter: ''
    LinkFilter: '{'LinkType','Implement'};'
          Host: ''

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

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

Tips

  • To check if a requirement is filtered, use the isFilteredIn method of slreq.Requirement. 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.

Version History

Introduced in R2022b