Change Block Icon and Port Labels
To change the icon appearance of your block, you must add specific methods to your System object™. For example, to define port labels, implementgetInputNamesImpl
andgetOutputNamesImpl
.
To define the icon, implement the
getIconImpl
method.To define the port labels, implement
getInputNamesImpl
to change the input andgetOutputNamesImpl
to change the output port labels.
If you do not implement these methods, by default the System object uses the input and output port names from thestepImpl
method. If you are using nondirect feedthrough, by default the System object uses the input names fromupdateImpl
and the output port names fromoutputImpl
.
Modify MATLAB System Block Dialog
To change theMATLAB Systemblock dialog, implementgetPropertyGroupsImpl
and inside the method implement the following classes:
Description | matlab.system.display Methods |
---|---|
Define header text for property group. |
|
Group properties together. |
|
Group properties into a separate tab. |
Change the MATLAB System Block Icon to an Image
You can change the image ofMATLAB Systemblock in MATLAB®Editor. For a list of accepted image files, seeimage
. To use an existing image file for theMATLAB Systemblock:
Double-click yourMATLAB Systemblock.
In the block dialog box, click theSource code. The MATLAB Editor that contains the System object code opens.
In the MATLAB Editor, from theSystem Blockdrop-down list, selectAdd Image Icon.
In theAdd image icondialog window, clickBrowseto select an image of your choice.
ClickOKto insert the corresponding code for the
getIconImpl
method in your System object.
For more information, seeCustomize System Block Appearance.