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
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.
|addAttribute||Add custom attribute to link set|
|deleteAttribute||Delete custom attribute from link set|
|exportToVersion||Export link set to previous MATLAB version|
|find||Find links in link set with matching attribute values|
|getLinks||Get links from link set|
|getRegisteredReqSets||Get requirement sets registered in link set|
|inspectAttribute||Get information about link set custom attribute|
|redirectLinksToImportedReqs||Redirect link destination from external document to imported requirement set|
|save||Save link set|
|sources||Get link sources|
|updateAttribute||Update information for link set custom attribute|
|updateBacklinks||Synchronize external navigation links|
|updateDocUri||Update link destination for direct links|
|updateRegisteredReqSets||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