Main Content

Stateflow.Annotation

Create annotation

Syntax

annotation_new = Stateflow.Annotation(parent)

Description

The Stateflow.Annotation method is a constructor method for creating an annotation in a parent chart, state, box, or graphical function. This method returns a handle to the new Annotation object.

Arguments

parent

Handle to the object for the parent chart, state, box, or function for the new annotation

Returns

annotation_new

Handle to the Annotation object for the newly created annotation

Examples

If sA is a handle to a State object for the existing state A, the following command creates a new annotation parented (contained by) state A:

annotation_new = Stateflow.Annotation(sA)

The new annotation appears in the upper left corner of state A in the chart, but is invisible because it has no text content. annotation_new is a handle to the Annotation object for the new annotation, that you use to set its text content with a command like the following:

annotation_new.Text = 'This is an annotation'
Introduced before R2006a