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

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?

 Risposta accettata

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');

3 Commenti

Thanks a lot. Although my MATLAB R2011a had a little bit different wording in menues, it was all obvious...
How do you make the labels appear on every instance use of s function
How do we use these commands from the S-Function c code to draw them at every instance the S-function is used?

Accedi per commentare.

Più risposte (0)

Prodotti

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by