This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Class: matlab.system.mixin.CustomIcon
Package: matlab.system.mixin

Name to display as block icon


icon = getIconImpl(obj)


icon = getIconImpl(obj) specifies the text or image to display on the block icon of the MATLAB System block. If you do not specify the getIconImpl method, the block displays the class name of the System object™ as the block icon. For example, if you specify pkg.MyObject in the MATLAB System block, the default icon is labeled MyObject

getIconImpl is called by the MATLAB System block during Simulink® model compilation.

    Note:   You must set Access = protected for this method.

Input Arguments


System object handle

Output Arguments


The text or image to display as the block icon. Each cell is displayed as a separate line.


expand all

Specify in your class definition file the name of the block icon as 'Enhanced Counter' using two lines.

methods (Access = protected)
   function icon = getIconImpl(~)
      icon = {'Enhanced','Counter'};

Define an image in your class definition file.

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

The image now appears on the System block icon.

Was this topic helpful?