Main Content


Class: slreq.Requirement
Namespace: slreq

Get requirement description as plain text

Since R2023a



description = getDescriptionAsText(req) returns the description of the requirement, req, as plain text.

Input Arguments

expand all

Requirement, specified as an slreq.Requirement object.

Output Arguments

expand all

Requirement description, returned as a character vector.


expand all

Suppose you have a requirement set in the current folder, myReqs.slreqx, and you want to retrieve the descriptions of the requirements. Load the requirement set with the slreq.load function.

reqset = slreq.load("myReqs.slreqx");

Retrieve the requirements with the find method.

reqs = reqset.find("Type","Requirement");

Create a for-loop that retrieves the description for each requirement in the slreq.Requirement object array.

reqDescriptions = cell(length(reqs),1);
for k = 1:length(reqs)
  reqDescriptions{k} = reqs(k).getDescriptionAsText;
ans =

    'This is the requirement description'

Version History

Introduced in R2023a