MATLAB: How to display port names in S-Function block just like they show up for Simulink subsystems

port names-functionsimulink

When we use input/output ports with Simulink Subsystems, their names (assigned inside the subsystem) appear outside the subsystem block. Similar is the case with MATLAB Function. I want the same functionality for the ports of blocks defined as Level-2 Matlab S-Functions. Any way for this?

Best Answer

You can create a Mask on top of the block and create your own icon and port labels. Right click on the block and select Mask>Create Mask. In the "Icon Drawing Commands" box enter commands like:
port_label('input', 1, 'input1');
port_label('output', 1, 'output1');