Main Content

slreq.convertAnnotation

R2026b

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

collapse all

  1. Find annotations in a Simulink model.

    allAnnotations = find_system("controller_Model",FindAll="on", ...
       Type="annotation");
  2. Create a new requirement set.

    newReqSet = slreq.new("myNewReqSet");
  3. 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

collapse all

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.

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