slreq.createLink
Create traceable links
Description
Examples
Create Links
This example shows how to create a link.
Open the ShortestPath
example.
openProject("ShortestPath");
Load the shortest_path_tests_reqs
requirement set.
rs = slreq.load("shortest_path_tests_reqs");
Get a handle to the requirement with the index 2.1.3
.
req = find(rs,Index="2.1.3");
Find the line range associated with line number four in the graph_unit_tests
MATLAB® code file.
lr = slreq.getTextRange("graph_unit_tests.m",4);
Create a link between the requirement and the line of code in the MATLAB file.
myLink = slreq.createLink(req,lr);
Get a handle to the link set, then save it.
myLinkSet = linkSet(myLink); tf = save(myLinkSet)
tf = logical
1
Input Arguments
src
— Link source item
string scalar | character vector | double | slreq.Requirement
object | slreq.Reference
object | ...
Link source 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
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
Output Arguments
myLink
— Link
slreq.Link
object
Link, returned as an slreq.Link
object.
Limitations
MATLAB® Online™ does not support linking to requirements in Microsoft® Word, Microsoft Excel®, or IBM® DOORS® documents.
Version History
Introduced in R2018a
See Also
Classes
Functions
Commande MATLAB
Vous avez cliqué sur un lien qui correspond à cette commande MATLAB :
Pour exécuter la commande, saisissez-la dans la fenêtre de commande de MATLAB. Les navigateurs web ne supportent pas les commandes MATLAB.
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)