Main Content

setImage

Specify image to display as annotation

Description

example

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

Examples

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.

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

Change the annotation to display only the specified image.

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

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