Open and highlight line range in MATLAB Editor
Create Line Ranges and Link to Requirement
This example shows how to create an
slreq.TextRange object and link it to a requirement.
slreq.TextRange object that corresponds to line numbers 1 and 2 in the
tr = slreq.createTextRange("myAdd.m",[1 2]);
slreq.TextRange object in the MATLAB® Editor.
myAddRequirements requirement set.
rs = slreq.load("myAddRequirements");
Get a handle to the requirement with the summary
Add u and v.
req = find(rs,Summary="Add u and v");
Create a link from the
slreq.TextRange object to the requirement.
myLink = slreq.createLink(tr,req);
Introduced in R2022b