Main Content


Class: slreq.Requirement
Package: slreq

Add comments to requirements


newComment = addComment(req,myComment)


newComment = addComment(req,myComment) adds a comment, myComment, to the requirement req.

Input Arguments

expand all

Requirement, specified as an slreq.Requirement object.

Comment text to add to the requirement, specified as a string scalar or character vector.

Output Arguments

expand all

New comment data, returned as a structure containing these fields:

Name of the individual or organization who added the comment, returned as a character vector.

Date that the comment was added, returned as a datetime object.

Comment revision number, returned as an int32 object.

Comment text, returned as a character vector.


expand all

This example shows how to add comments to requirements.

Load the requirement set basicReqSet.

rs = slreq.load("basicReqSet");

Find the first requirement in the set.

req = find(rs,Index=1);

Add a comment to the requirement.

newComment = addComment(req,"My new comment.");


Alternative Functionality


You can also add a comment by using the Requirements Editor. Select a requirement and, in the right pane, under Comments, click Add Comment.

Version History

Introduced in R2017b