Main Content


Class: slreq.Reference
Namespace: slreq

Get incoming links for referenced requirements


myLinks = inLinks(ref)


myLinks = inLinks(ref) returns the incoming links for the referenced requirement ref.

Input Arguments

expand all

Referenced requirement, specified as a slreq.Reference object.

Output Arguments

expand all

Incoming links for the requirement, returned as an slreq.Link array.


expand all

This example shows how to get incoming and outgoing links for referenced requirements.

Open the MyAdd2 project. Load the myAddReqs and myAddTestSpecification requirement sets.

rs1 = slreq.load("myAddTestSpecification");
rs2 = slreq.load("myAddReqs");

In the MyAdd2 requirement set, find the referenced requirement with index 1.1.

ref = find(rs1,Index="1.1");

In the myAddReqs requirement set, find the requirement with index 4.

req = find(rs2,Index="4");

Create a link from the referenced requirement to the requirement. Set the link type to Refine.

myLink = slreq.createLink(ref,req);
myLink.Type = "Refine";

Get the incoming links for the referenced requirement.

myInLinks = inLinks(ref);

Get the outgoing links for the referenced requirement.

myOutLinks = outLinks(ref);


  • To get the incoming links for a requirement, use the inLinks method of slreq.Requirement.

Alternative Functionality


You can also use the Requirements Editor to view incoming links. Select a referenced requirement. In the right pane, under Links, the incoming links icon indicates incoming links.

Version History

Introduced in R2017b