Main Content

getDescriptionAsText

Class: slreq.Requirement
Namespace: slreq

Get requirement description as plain text

Since R2023a

Description

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

example

Input Arguments

expand all

Requirement, specified as an slreq.Requirement object.

Output Arguments

expand all

Requirement description, returned as a character vector.

Examples

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;
end
reqDescriptions{1}
ans =

    'This is the requirement description'

Version History

Introduced in R2023a