MATLAB Help Center
Delete annotation
delete(a)
delete(a) deletes the specified annotation.
a
example
collapse all
This example shows how to delete an annotation in the vdp model programmatically.
vdp
Open the example. Then, open the vdp model.
open_system('vdp')
To get the handles for the annotations in the model, use the find_system function.
find_system
h = find_system(gcs,'FindAll','on','Type','annotation');
To identify the annotations, query the text inside the annotations.
get_param(h,'PlainText')
ans = 3×1 cell {'Copyright 2004-2024 The MathWorks, Inc.'} {'Van der Pol Equation' } {'x_1' =x_2↵↵x_2' =µ(1-x_1^2) x_2 - x_1' }
To delete the annotation at the top of the model, 'Van der Pol Equation', get the Simulink.Annotation object that corresponds to the second handle.
'Van der Pol Equation'
Simulink.Annotation
an = get_param(h(2),'Object');
Delete the annotation from the model.
delete(an)
Get the handles for the annotations in the model. Then, query the text inside the annotations.
h1 = find_system(gcs,'FindAll','on','Type','annotation'); get_param(h1,'PlainText')
ans = 2×1 cell {'Copyright 2004-2024 The MathWorks, Inc.'} {'x_1' =x_2↵↵x_2' =µ(1-x_1^2) x_2 - x_1' }
The model no longer has an annotation with 'Van der Pol Equation' as text.
Annotation, specified as a Simulink.Annotation object.
Introduced before R2006a
Simulink.Annotation | view | setImage
view
setImage
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
Europe
Asia Pacific
Contact your local office