Main Content

addComment

Class: slreq.Requirement
Namespace: slreq

Add comments to requirements

Syntax

newComment = addComment(req,myComment)

Description

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.

Examples

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.");

Tips

  • To add comments to referenced requirements, use the addComment method of slreq.Reference. To add comments to justifications, use the addComment method of slreq.Justification. To add comments to links, use the addComment method of slreq.Link.

Alternative Functionality

App

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