Main Content

image

Display RGB image on masked subsystem icon

Syntax

image(a)
image(a, position)
image(a, position, rotation)

Description

image(a) displays the image a, where a is an m-by-n-by-3 array of RGB values. If necessary, use the MATLAB® commands imread and ind2rgb to read and convert bitmap files (such as GIF) to the necessary matrix format.

image(a, position) creates the image at the specified position as follows.

PositionDescription
[x, y, w, h]Position (x, y) and size (w, h) of the image where the position is relative to the lower-left corner of the mask. The image scales to fit the specified size.
'center'Center of the mask
'top-left'Top left corner of the mask, unscaled
'bottom-left'Bottom left corner of the mask, unscaled
'top-right'Top right corner of the mask, unscaled
'bottom-right'Bottom right corner of the mask, unscaled

image(a, position, rotation) allows you to specify whether the image rotates ('on') or remains stationary ('off') as the icon rotates. The default is 'off'.

Note

Images in formats .cur, .hdf4, .ico, .pcx, .ras, .xwd, .svg (full version) cannot be used as block mask images.

Examples

You can use different commands depending on your requirement to add an image. These commands can be added in the Icon & Ports pane of the Mask Editor dialog box.

SyntaxDescription
image('icon.jpg')

Reads the icon image from a JPEG file named icon.jpg in the MATLAB path.

[data, map]=image('label.gif');
pic=ind2rgb(data,map);

Reads and converts a GIF file, label.gif, to the appropriate matrix format.

image(pic)

Reads the converted label image.

Version History

Introduced before R2006a

See Also

|