Main Content

slreq.generateTraceabilityDiagram

Create a traceability diagram

Since R2021b

    Description

    example

    slreq.generateTraceabilityDiagram(startingItem) creates a traceability diagram that originates from startingItem. If a traceability diagram is already open for the specified item, the diagram comes to the foreground.

    Note

    If you create a diagram from a link, the link source is the starting node. Similarly, if you create a diagram from a link set, the artifact specified by the Artifact is the starting node.

    Examples

    collapse all

    This example shows how to create a traceability diagram from a requirement object.

    Open the ShortestPath project. Load the shortest_path_func_reqs requirement set.

    openProject("ShortestPath");
    slreq.load("shortest_path_func_reqs");

    Open the MATLAB® code files shortest_path.m and graph_unit_tests.m.

    open("shortest_path.m");
    open("graph_unit_tests.m");

    Find requirement 2.1.1.

    req = slreq.find(Type="Requirement",Index="2.1.1");

    Create a traceability diagram for the Enable Switch Detection requirement.

    slreq.generateTraceabilityDiagram(req)

    This example shows how to create a traceability diagram from a link object.

    Open the ShortestPath project. Load the shortest_path_func_reqs requirement set.

    openProject("ShortestPath");
    rs = slreq.load("shortest_path_func_reqs");

    Get a handle to the shortest_path link set.

    myLinkSet = slreq.find(Type="LinkSet",Name="shortest_path");

    Return an array of the links in the link set. Get a handle to the 10th link in the link set.

    myLinks = getLinks(myLinkSet);
    myLink = myLinks(10);

    Create a traceability diagram from the link.

    slreq.generateTraceabilityDiagram(myLink)

    This example shows how to create a traceability diagram from a requirement set.

    Open the ShortestPath project. Load the shortest_path_tests_reqs requirement set.

    openProject("ShortestPath");
    rs = slreq.load("shortest_path_tests_reqs");

    Create a traceability diagram for the shortest_path_tests_reqs requirement set.

    slreq.generateTraceabilityDiagram(rs)

    This example shows how to create a traceability diagram from a link set.

    Open the ShortestPath project. Load the shortest_path_tests_reqs requirement set.

    openProject("ShortestPath");
    rs = slreq.load("shortest_path_tests_reqs");

    Get a handle to the graph_unit_tests link set.

    ls = slreq.find(Type="LinkSet",Name="graph_unit_tests");

    Create a traceability diagram for the link set.

    slreq.generateTraceabilityDiagram(ls)

    Close the link set and the Traceability Diagram window.

    Input Arguments

    collapse all

    Starting item to create the traceability diagram from, specified as a:

    Version History

    Introduced in R2021b