Main Content


Class: slreq.Requirement
Namespace: slreq

Get requirement rationale as plain text

Since R2023a



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

Input Arguments

expand all

Requirement, specified as an slreq.Requirement object.

Output Arguments

expand all

Requirement rationale, 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 rationales 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 rationale for each requirement in the slreq.Requirement object array.

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

    'The is the requirement rationale'

Version History

Introduced in R2023a