Main Content

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, implementgetInputNamesImplandgetOutputNamesImpl.

  1. To define the icon, implement thegetIconImplmethod.

  2. To define the port labels, implementgetInputNamesImplto change the input andgetOutputNamesImplto 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 thestepImplmethod. If you are using nondirect feedthrough, by default the System object uses the input names fromupdateImpland the output port names fromoutputImpl.

Modify MATLAB System Block Dialog

To change theMATLAB Systemblock dialog, implementgetPropertyGroupsImpland inside the method implement the following classes:

Description matlab.system.display Methods

Define header text for property group.

matlab.system.display.Header

Group properties together.

matlab.system.display.Section

Group properties into a separate tab.

matlab.system.display.SectionGroup

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:

  1. Double-click yourMATLAB Systemblock.

  2. In the block dialog box, click theSource code. The MATLAB Editor that contains the System object code opens.

  3. 在MATLAB编辑器,从System Blockdrop-down list, selectAdd Image Icon.

  4. In theAdd image icondialog window, clickBrowseto select an image of your choice.

  5. ClickOKto insert the corresponding code for thegetIconImplmethod in your System object.

For more information, seeCustomize System Block Appearance.

See Also

|

Related Topics