Using Simulink | ![]() ![]() |
Displaying Images on Masks
The masked dialog functions, image
and patch
, enable you to display bitmapped images and draw patches on masked block icons.
image(a)
displays the image a
where a
is an M by N by 3 array of RGB values. You can use the MATLAB commands, imread
and ind2rgb
, to read and convert bitmap files to the necessary matrix format. For example,
image(imread('icon.tif'))
reads the icon image from a TIFF file named icon.tif
in the MATLAB path.
image(a, [x, y, w, h])
creates the image at the specified position relative to the lower left corner of the mask.
image(a, [x, y, w, h], rotation)
allows you to specify whether the image rotates ('on'
) or remains stationary ('off'
) as the icon rotates. The default is 'off'
.
patch(x, y)
creates a solid patch having the shape specified by the coordinate vectors x
and y
. The patch's color is the current foreground color.
patch(x, y, [r g b])
creates a solid patch of the color specified by the vector [r g b]
, where r
is the red component, g
the green, and b
the blue. For example,
patch([0 .5 1], [0 1 0], [1 0 0])
creates a red triangle on the mask's icon.
![]() | Displaying Graphics on the Block Icon | Displaying a Transfer Function on the Block Icon | ![]() |