delete
Delete annotation
Syntax
Description
Examples
Delete Annotation
This example shows how to delete an annotation in the vdp
model programmatically.
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.
h = find_system(gcs,'FindAll','on','Type','annotation');
To identify the annotations, query the text inside the annotations.
get_param(h,'PlainText')
ans = 3x1 cell
{'Copyright 2004-2022 The MathWorks, Inc.'}
{'Van der Pol Equation' }
{'x'' - µ(1-x^2) x' + x = 0' }
To delete the title of the model, 'Van der Pol Equation'
, get the Simulink.Annotation
object that corresponds to the second handle.
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 = 2x1 cell
{'Copyright 2004-2022 The MathWorks, Inc.'}
{'x'' - µ(1-x^2) x' + x = 0' }
The model no longer has an annotation with 'Van der Pol Equation'
as text.
Input Arguments
a
— Annotation
Simulink.Annotation
object
Annotation, specified as a Simulink.Annotation
object.
Version History
Introduced before R2006a
MATLAB Command
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
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)