setDestination
Class: slreq.Link
Namespace: slreq
Set requirement link destination
Description
Input Arguments
myLink
— Link
slreq.Link
object
Link, specified as an slreq.Link
object.
dest
— Link destination item
string scalar | character vector | double | slreq.Requirement
object | slreq.Reference
object | ...
Link destination item, specified as a:
slreq.Requirement
orslreq.Reference
objectString scalar or character vector that lists the name of a Simulink® model or path to a Simulink block or subsystem, a Stateflow® chart, or a System Composer™ port or component
Handle to a Simulink block or subsystem or a System Composer port or component
Stateflow.Chart
(Stateflow),Stateflow.State
(Stateflow), orStateflow.Transition
(Stateflow) objectSimulink.data.dictionary.Entry
(Simulink) objectsltest.testmanager.TestFile
(Simulink Test),sltest.testmanager.TestSuite
(Simulink Test),sltest.testmanager.TestCase
(Simulink Test), orsltest.testmanager.TestIteration
(Simulink Test) objectFault
(Simulink Fault Analyzer),Conditional
(Simulink Fault Analyzer),SpreadsheetCell
(Simulink Fault Analyzer), orSpreadsheetRow
(Simulink Fault Analyzer) objectslreq.TextRange
object
Examples
Find and Repair Broken Links
This example shows how to find and repair broken links.
Load the myAddRequirements
requirement set, which links to lines of code in myAddBroken.m
.
rs = slreq.load("myAddBroken");
Get a handle to the link set.
myLinkSet = slreq.find(Type="LinkSet");
Find the broken links in the link set. Display the number of broken links.
brokenLinks = getBrokenLinks(myLinkSet); numBrokenLinks = numel(brokenLinks)
numBrokenLinks = 1
Get a handle to the requirement that has the Summary
property set to Add u and v
.
req = slreq.find(Type="Requirement",Summary="Add u and v");
Repair the broken link by using the setDestination
method.
setDestination(brokenLinks(1),req)
Confirm that there are no broken links.
brokenLinks = getBrokenLinks(myLinkSet)
brokenLinks = []
Version History
Introduced in R2019b
See Also
Classes
Functions
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)