Main Content


Specify image to display as annotation



setImage(a,img) changes the annotation to display only the specified image.


collapse all

This example shows how to add an image to your model, such as a logo, by creating an image-only annotation programmatically.

Open the example. Then, open a new model and create an annotation in it.

a = Simulink.Annotation(gcs,'This is an annotation.');

Change the annotation to display only the specified image.

img = fullfile(pwd,'drivingCar_24.png');

Input Arguments

collapse all

Annotation, specified as a Simulink.Annotation object.

Image filename, specified as a character vector or string scalar. The filename must contain the file extension and can include a partial path, complete path, relative path, or no path.

Data Types: char | string

Version History

Introduced in R2014a