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

ah = find_system(gcs, 'FindAll', 'on', 'type', 'annotation');
ao = get_param(ah(1), 'Object');
ao.DropShadow = 'on';

Children

None.

Property Summary

PropertyDescriptionValues
Text

String specifying text of annotation. Same as Name.

string

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 Associating Click Functions with Annotations for more information.

string

Description

String that describes this annotation.

string

FontAngle

String specifying the angle of the annotation's font. The default value, 'auto', specifies use of the model's preferred font angle.

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

FontName

String specifying name of annotation's font. The default value, 'auto', specifies use of the model's preferred font.

string

FontSize

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

real {'-1'}

FontWeight

String specifying the weight of the annotation's font. The default value, 'auto', specifies use of the model's preferred font weight.

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

Handle

Annotation handle.

real

HiliteAncestors

For internal use.

 
Name

String specifying text of annotation. Same as Text.

string

Selected

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

{'on'} | 'off'

Parent

String specifying parent name of annotation object.

string

Path

Path to the annotation.

string

Position

Two-element vector specifying the x-y coordinates of this annotation relative to the top, left corner of the block diagram, e.g., [236 83].

vector [left bottom]
not enclosed in quotation marks. The maximum value for a coordinate is 32767.

HorizontalAlignment

String specifying the horizontal alignment of this annotation, e.g., 'center'.

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

VerticalAlignment

String specifying the vertical alignment of this annotation, e.g., 'middle'.

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

ForegroundColor

String specifying foreground color of this annotation.

RGB value array string | [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.

Block background color can also be 'black', 'white', 'red', 'green', 'blue', 'cyan', 'magenta', 'yellow', 'gray', 'lightBlue', 'orange', 'darkGreen'.

BackgroundColor

String specifying background color of this annotation.

RGB value array string | [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.

Block background color can also be 'black', 'white', 'red', 'green', 'blue', 'cyan', 'magenta', 'yellow', 'gray', 'lightBlue', 'orange', 'darkGreen'.

DropShadow

String specifying whether to display a drop shadow. Options are 'on' or 'off'.

'on' | {'off'}

TeXMode

String specifying whether to render TeX markup. Options are 'on' or 'off'.

'on' | {'off'}

Type

Annotation type. This is always 'annotation'

string

LoadFcn

String specifying M-code to be executed when the model containing this annotation is loaded. See Annotation Callback Functions in the online Simulink documentation.

string

DeleteFcnString specifying M-code to be executed before deleting this annotation. See Annotation Callback Functions in the online Simulink documentation.

string

RequirementInfo

For internal use.

string

Tag

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

string

UseDisplayTextAsClickCallback

String specifying whether to use the contents of the Text property as this annotation's click function. 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 on the annotation runs the click function, if there is one. If there is no click function, clicking the annotation has no effect.

See Associating Click Functions with Annotations in the Simulink documentation for more information.

'on' | {'off'}

UserData

Any data that you want to associate with this annotation.

vector

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS