| Contents | Index |
image(a) image(a, position) image(a, position, rotation)
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.
| Position | Description |
|---|---|
| [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'.
The command
image(imread('icon.jpg'))
reads the icon image from a JPEG file named icon.jpg in the MATLAB path.
The following commands read and convert a GIF file, label.gif, to the appropriate matrix format. You can type these commands in the Initialization pane of the Mask Editor.
[data, map]=imread('label.gif');
pic=ind2rgb(data,map);
Then type the command
image(pic)
in the Icon pane of the Mask Editor to read the converted label image.

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |