You can associate these callback functions with annotations.
You can make an annotation interactive using a link. Alternatively, you can make an annotation interactive by adding a click function callback. A click function is a MATLAB® function that Simulink® invokes when you click an annotation.
You can add a click function callback programmatically or interactively. To create this association programmatically, see Annotations API. To create one interactively, see Associate a Click Function with an Annotation.
The text for annotations associated with a click function appears in blue.
Simulink invokes a load function when you load the model
that contains the associated annotation. To associate a load function
with an annotation, set the
LoadFcn property of
the annotation to the desired function (see Annotations API).
A delete function is invoked before you delete an annotation.
To associate a delete function with an annotation, set the
of the annotation to the desired function (see Annotations API).
You can interactively associate a click function with an annotation.
Add an annotation. Enter the annotation content but do not change any formatting. Changing formatting prevents you from adding a click function using the Simulink Editor.
Open the Annotation Properties dialog box. Right-click the annotation and select Properties.
Open the ClickFcn tab. In the text box under ClickFcn, enter the MATLAB code that defines the click function, and click OK.
Tip Alternatively, you can use the annotation text as the click function. Then, in the Annotation Properties dialog box, select the Use annotation text as click callback check box.
If you associate an annotation with a click function, sometimes you cannot select the annotation by clicking. Instead, to select it, drag a selection box around it.
You cannot interactively edit the text in an annotation that is associated with a click function. To edit the annotation, right-click it and select Properties to use the Annotation Properties dialog box.