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 a click
function programmatically, see
Simulink.Annotation. 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
A delete function is invoked before you delete an annotation. To associate a delete function
with an annotation, set the
DeleteFcn property of the annotation to the
desired function (see
You can interactively associate a click function with an annotation.
Add an annotation.
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.
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, clicking invokes the function rather than selecting the annotation. To select it instead, drag a selection box around it. To edit it, right-click it and select Edit Text or Properties.