Main Content

delete

Delete annotation

Syntax

Description

example

delete(a) deletes the specified annotation.

Examples

collapse all

Programmatically delete an annotation.

Open the vdp model.

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 = 2x1 cell
    {'Copyright 2004-2020 The MathWorks, Inc.'}
    {'van der Pol Equation'                   }

To delete the title of the model ('van der Pol Equation'), get the Simulink.Annotation object that corresponds to the second handle.

a = get_param(h(2),'Object');

Delete the annotation from the model.

delete(a)

Input Arguments

collapse all

Annotation, specified as a Simulink.Annotation object.

Introduced before R2006a