Simulink.Annotation

Specify properties of model annotation

Description

Instances of this class specify the properties of annotations.
You can use getCallbackAnnotation in
an annotation callback function to get the Simulink.Annotation instance
for the annotation associated with the callback function. You can
use find_system and get_param to get the Simulink.Annotation instance
associated with any annotation in a model. For example, the following
code gets the annotation object for the first annotation in the currently
selected model and turns on its drop shadow

Children

None.

Property Summary

Property

Description

Values

Text

Text of annotation. Same as Name.

character vector

ClickFcn

Specifies MATLAB® code to be executed when a user
single-clicks this annotation. Simulink® software stores the code
entered in this field with the model. See Associate a Click Function with an Annotation for more
information.

character vector

Description

Description of this annotation.

character vector

FontAngle

Angle of the annotation font. The default value, 'auto',
specifies use of the model preference for the font angle.

'normal' | 'italic' | 'oblique' | {'auto'}

FontName

Name of annotation font. The default value, 'auto',
specifies use of the model preference for the font.

character vector

FontSize

Integer specifying size of annotation's font in
points. The default value, -1, specifies use of
the model preference for the font size.

real {'-1'}

FontWeight

Weight of the annotation font. The default value, 'auto',
specifies use of the model preference for font weight.

'light' | 'normal' | 'demi' | 'bold' | {'auto'}

Handle

Annotation handle.

real

HiliteAncestors

For internal use.

Name

Text of annotation. Same as Text.

character vector

Selected

Character vector specifying whether this annotation is
currently selected ('on') or not selected ('off').

'on' | 'off'

Parent

Parent name of annotation object.

character vector

Path

Path to the annotation.

character vector

Position

Array specifying the location of the annotation

1x4 array [left top right bottom].

The
maximum value for a coordinate is 32767.

HorizontalAlignment

Horizontal alignment of this annotation, e.g., 'center'.

'center' | {'left'}|'right'

VerticalAlignment

Vertical alignment of this annotation (for example, 'middle'.

'middle' | {'top'}|'cap'|'baseline'|'bottom'

ForegroundColor

Foreground color of this annotation.

RGB value array | [r,g,b,a] where r, g, b,
and a are the red, green, blue, and alpha values
of the color normalized to the range 0.0 to 1.0, delineated with commas.
The alpha value is optional and ignored.

RGB value array | [r,g,b,a] where r, g, b,
and a are the red, green, blue, and alpha values
of the color normalized to the range 0.0 to 1.0, delineated with commas.
The alpha value is optional and ignored.

User-specified text that is assigned to the annotation Tag parameter
and saved with the annotation.

character vector

UseDisplayTextAsClickCallback

Character vector specifying whether to use the contents
of the Text property as the click function for
this annotation. Options are 'on' or 'off'.

If
set to 'on', the text of the annotation is interpreted
as a valid MATLAB expression and run. If set to 'off',
clicking the annotation runs the click function, if there is one.
If there is no click function, clicking the annotation has no effect.