Main Content

addComment

Class: slreq.Reference
Package: slreq

Add comments to referenced requirements

Syntax

newComment = addComment(ref,myComment)

Description

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

Input Arguments

expand all

Referenced requirement, specified as a slreq.Reference object.

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

Output Arguments

expand all

Comment added, 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 referenced requirements.

Load the requirement set crs_req.

rs = slreq.load("crs_req");

Find the first referenced requirement in the set.

ref = find(rs,Index=1);

Add a comment to the referenced requirement.

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

Tips

Alternative Functionality

App

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

Version History

Introduced in R2018b