Main Content

source

Class: slreq.Link
Package: slreq

Get link source

Description

example

src = source(myLink) returns a link source of the link myLink.

Input Arguments

expand all

Link, specified as an slreq.Link object.

Output Arguments

expand all

Link source, returned as a MATLAB® structure that contains these fields:

  • domain

  • artifact

  • id

Examples

expand all

This example shows how to get a link source from a link object.

Load the crs_req requirement files, which contain links for a cruise control system.

slreq.load("crs_req");
slreq.load("crs_req_func_spec");

Find the crs_req link set.

myLinkSet = slreq.find(Type="LinkSet",Description="crs_req");

Get the links from the link set.

myLinks = getLinks(myLinkSet)
myLinks=1×12 object
  1x12 Link array with properties:

    Type
    Description
    Keywords
    Rationale
    CreatedOn
    CreatedBy
    ModifiedOn
    ModifiedBy
    Revision
    SID
    Comments

Get the link source structure for one of the links.

src = source(myLinks(1));

Convert the link source structure to an object.

srcObj = slreq.structToObj(src);

Tips

Version History

Introduced in R2018a