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

Add an image to your model, such as a logo, by creating an image-only annotation.

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(matlabroot,'toolbox','matlab','imagesci','peppers.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