Work with link sets
slreq.LinkSet are Link Set objects. Links are
organized in link sets. Each link set is associated with a source artifact such as a
Simulink® model or a data dictionary and is serialized into a separate file which
stores the links associated with it. The default location and name of the link set file
matches that of the source artifact.
finds and returns an array of loaded
allLinkSets = slreq.find(
ArtifactName — Link set artifact name
The name of the link set artifact, specified as a character vector.
allLinkSets — Link sets
Array of loaded link sets.
myLinkSet — Link set
Link set, returned as an
Filename — Link set file path
File path of the link set, specified as a character vector. By default,
the link set is stored in the same folder as the artifact and has the same
base file name and an
Artifact — Artifact containing link sources
Artifact that contains the link sources for the link set, specified as a
character vector. When you create a link, the link set is associated with
the artifact that the link source item belongs to. By default, the link set
is stored in the same folder as the artifact and has the same base file name
.slmx extension. For more information, see Requirements Link Storage. The artifact can be any file that
contains a linkable item, such as a Simulink model or a Simulink
Domain — Link set custom link type
The custom link type of the links in the link set. For more information, see Custom Link Types.
Revision — Link set revision number
Link set revision number, specified as a scalar.
Dirty — Unsaved changes indicator
Indicates if the link set has unsaved changes.
no unsaved changes and
1 for unsaved changes.
Description — Link set description
Link set description text, specified as a character vector.
CustomAttributeNames — Custom attributes associated with the link set
cell array of character vectors
Link set custom attribute names, specified as a cell array of character vectors.
|Add custom attribute to link set
|Create line ranges
|Delete custom attribute from link set
|Export link set to previous MATLAB version
|Find links in link set with matching attribute values
|Get links from link set
|Get requirement sets registered in link set
|Get line ranges
|Get lines ranges that span multiple lines
|Assign profile to ink set
|Get information about link set custom attribute
|Get profiles assigned to link set
|Redirect link destination from external document to imported requirement set
|Remove profile from link set
|Save link set
|Get link sources
|Update information for link set custom attribute
|Synchronize external navigation links
|Update link destination for direct links
|Update requirement sets registered to link set
Find, Load, and Edit a Link Set
This example shows how to find, load, and edit a link set.
Find a loaded link set by using the name.
myLinkSet1 = slreq.find("Type","LinkSet","Name","Project_req")
myLinkSet1 = LinkSet with properties: Description: '' Filename: 'Project_req.slmx' Artifact: 'Project_req.slreqx' Domain: 'linktype_rmi_slreq' Revision: 2 Dirty: 0
Load a link set associated with a Simulink model called
myLinkSet2 = slreq.load("fuelsys.slx")
myLinkSet2 = LinkSet with properties: Description: '' Filename: 'C:\MATLAB\My_Files\fuelsys_linkset.slmx' Artifact: 'D:\Work\Design_Specs\fuelsys.slx' Domain: 'linktype_rmi_simulink' Revision: 2 Dirty: 0
Set the link set description.
myLinkSet2.Description = "Link set for the fuel system"
myLinkSet2 = LinkSet with properties: Description: 'Link set for the fuel system' Filename: 'C:\MATLAB\My_Files\fuelsys_linkset.slmx' Artifact: 'D:\Work\Design_Specs\fuelsys.slx' Domain: 'linktype_rmi_simulink' Revision: 2 Dirty: 1
Introduced in R2018a