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 thegetIconImpl
method.
To define the port labels, implementgetInputNamesImpl
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
.
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. |
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.
在MATLAB编辑器,从System Blockdrop-down list, selectAdd Image Icon.
In theAdd image icondialog window, clickBrowseto select an image of your choice.
ClickOKto insert the corresponding code for thegetIconImpl
method in your System object.
For more information, seeCustomize System Block Appearance.
MATLAB System|matlab.system.display.Icon