setDestination
R2026bClass: slreq.Link
Namespace: slreq
Set requirement link destination
Description
Input Arguments
Link, specified as an slreq.Link object.
Link destination item, specified as a:
slreq.Requirementorslreq.ReferenceobjectString 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) (since R2023b),SpreadsheetRow(Simulink Fault Analyzer) (since R2024b),Event(Simulink Fault Analyzer),Gate(Simulink Fault Analyzer), orFailureModel(Simulink Fault Analyzer) object (since R2026b)slreq.TextRangeobject (since R2022b)RequirementRowobject (since R2026a)String scalar or character vector that specifies the path to a MAT file (since R2024b)
Examples
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 R2019bYou can use external requirements as input arguments to the
setDestination method.. To set the destination of a link to an external
requirement, use a structure that has domain,
artifact, and id fields or reqsys,
doc, and id fields as an input to
setDestination. When you use a structure with these fields as an input,
Requirements Toolbox™ does not try to resolve the given destination. This may result in a broken
link. For more information, see Load and Resolve Links.
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.
Website auswählen
Wählen Sie eine Website aus, um übersetzte Inhalte (sofern verfügbar) sowie lokale Veranstaltungen und Angebote anzuzeigen. Auf der Grundlage Ihres Standorts empfehlen wir Ihnen die folgende Auswahl: .
Sie können auch eine Website aus der folgenden Liste auswählen:
So erhalten Sie die bestmögliche Leistung auf der Website
Wählen Sie für die bestmögliche Website-Leistung die Website für China (auf Chinesisch oder Englisch). Andere landesspezifische Websites von MathWorks sind für Besuche von Ihrem Standort aus nicht optimiert.
Amerika
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- 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)