Main Content

slreq.convertAnnotation

Convert annotations to requirement objects

Description

myReq = slreq.convertAnnotation(myAnnotation,myDestination) converts a Simulink® or a Stateflow® annotation myAnnotation into a requirement myReq and stores it in a destination entity myDestination.

myReq = slreq.convertAnnotation(myAnnotation,myDestination,Name,Value) converts a Simulink or a Stateflow annotation myAnnotation into a requirement myReq and stores it in a destination entity myDestination using additional options specified by one or more Name, Value pair arguments.

Examples

Convert Simulink Annotation to Requirement

% Find all annotations in a Simulink model
allAnnotations = find_system('controller_Model', 'FindAll', ...
'on', 'type', 'annotation');

% Create a new requirement set
newReqSet = slreq.new('myNewReqSet');

% Convert one annotation into a requirement newReq
% and add it to newReqSet
newReq = slreq.convertAnnotation(allAnnotations(1), ...
newReqSet);

Input Arguments

collapse all

The annotation to be converted, specified as a Simulink.Annotation object.

The destination entity for the converted annotation, specified either as an slreq.Requirement or as an slreq.ReqSet object.

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: 'CreateLinks', true

Option to create links when converting annotations, specified as a Boolean value.

Option to retain the annotation after conversion, specified as a Boolean value.

Option to specify annotation conversion even if a callback function is specified in the annotation, specified as a Boolean value.

Option to display the Requirement markup after annotation conversion, specified as a Boolean value.

Output Arguments

collapse all

The converted annotation, returned as an slreq.Requirement object.

Version History

Introduced in R2018a