Main Content

matlab.system.display.Icon class

Package: matlab.system.display

Custom icon image


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


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 (Simulink).

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 (Simulink).

Example: "image.png"


collapse 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");

The image now appears on the MATLAB System block icon.

Version History

Introduced in R2017a