Main Content

getRegisteredReqSets

Class: slreq.LinkSet
Namespace: slreq

Get requirement sets registered in link set

Since R2021b

Syntax

registeredReqSets = getRegisteredReqSets(myLinkSet)

Description

registeredReqSets = getRegisteredReqSets(myLinkSet) returns a cell array of the file names of the requirement sets registered to the link set myLinkSet.

Input Arguments

expand all

Link set, specified as an slreq.LinkSet object.

Output Arguments

expand all

File names of requirement sets registered in the link set, returned as a cell array.

Examples

expand all

This example shows how to get and update the requirement sets registered in a link set.

Open the CruiseRequirementsExample project.

openProject("CruiseRequirementsExample");

Load the crs_req requirement set, which describes a cruise control system. This action also loads the crs_req link set and the crs_req_func_spec requirement set.

slreq.load("crs_req");

Find the crs_req link set and the crs_req_func_spec requirement set.

myLinkSet = slreq.find("Type","LinkSet","Name","crs_req");
rs = slreq.find("Type","ReqSet","Name","crs_req_func_spec");

Get the requirement sets registered in the crs_req link set.

registeredReqSets = getRegisteredReqSets(myLinkSet);

Get the links from the crs_req link set. Remove all of the links from the crs_req link set and close the crs_req_func_spec requirement set.

links = getLinks(myLinkSet);
for i = 1:numel(links)
    remove(links(i));
end
close(rs);

Update the requirement sets registered to the link set crs_req. Confirm that the requirement set crs_req_func_spec is not registered in the link set crs_req by getting the currently registered requirement sets.

updateRegisteredReqSets(myLinkSet)
registeredReqSets = getRegisteredReqSets(myLinkSet)
registeredReqSets =

  0×0 empty cell array

Tips

  • When you create a link to a requirement, the requirement set of the requirement becomes registered to the link set of the link. If you delete the link to the requirement, you must manually unregister the requirement set from the link set. You can update the registered requirement sets by using updateRegisteredReqSets.

  • You can register a requirement set without creating a link by opening a requirement set in the Requirements Perspective in the Simulink® model editor.

Version History

Introduced in R2021b