MATLAB 帮助中心
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.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
欧洲
亚太
联系您当地的办事处