Documentation

matlab.system.display.Icon class

Package: matlab.system.display

Custom icon image

Syntax

icon = matlab.system.display.Icon(imageFile)

Description

icon = matlab.system.display.Icon(imageFile) sets the imageFile image as the MATLAB System block icon. To set the icon image, use the icon output argument from getIconImpl.

Input Arguments

expand all

Image file to display on the block icon, specified as a character array. If the image is not on the path, use the full path to your image file.

The image file must be in a file format supported for block masks. See Draw Static Icon.

Example: 'image.png'

Examples

expand all

Define an image in your class definition file.

    methods(Access = protected)
        function icon = getIconImpl(~)
            % Define icon for MATLAB System block
            icon = matlab.system.display.Icon('my_icon.png');
        end
    end

The image now appears on the MATLAB System block icon.

Introduced in R2017a

Was this topic helpful?