Main Content

slreq.createLink

Create traceable links

Description

example

myLink = slreq.createLink(src,dest) creates a link between the source item specified by src and the destination item specified by dest.

Examples

collapse all

This example shows how to create a link.

Open the ShortestPath example.

openProject("ShortestPath");

Load the shortest_path_tests_reqs requirement set.

rs = slreq.load("shortest_path_tests_reqs");

Get a handle to the requirement with the index 2.1.3.

req = find(rs,Index="2.1.3");

Find the line range associated with line number four in the graph_unit_tests MATLAB® code file.

lr = slreq.getTextRange("graph_unit_tests.m",4);

Create a link between the requirement and the line of code in the MATLAB file.

myLink = slreq.createLink(req,lr);

Get a handle to the link set, then save it.

myLinkSet = linkSet(myLink);
tf = save(myLinkSet)
tf = logical
   1

Input Arguments

collapse all

Link source item, specified as a:

Link destination item, specified as a:

Output Arguments

collapse all

Link, returned as an slreq.Link object.

Limitations

  • MATLAB® Online™ does not support linking to requirements in Microsoft® Word, Microsoft Excel®, or IBM® DOORS® documents.

Version History

Introduced in R2018a