Why Do Simulink Subsystem Ports Sometimes Show Numbers Instead of Names?
13 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
MathWorks Support Team
le 16 Déc 2025 à 0:00
Réponse apportée : MathWorks Support Team
le 16 Déc 2025 à 8:11
When I name Inport or Outport blocks in a subsystem as “Input” or “Output,” the subsystem icon shows port numbers instead of the names. Other names like “InputSignal” or “OutputData” display correctly.
Why does this happen, and how can I make the subsystem show the names I want?
Réponse acceptée
MathWorks Support Team
le 16 Déc 2025 à 0:00
This behavior depends on the subsystem’s ShowPortLabels setting. When this property is set to FromPortIcon, the subsystem uses the display setting of the underlying port block, which often defaults to showing the port number.
Simulink also applies rules to decide whether a block name is considered “default.” Names such as “In,” “Input,” “Out,” or “Output,” with or without numeric suffixes, are treated as default names. When a name is considered default, Simulink does not display it on the subsystem icon and instead shows the port number. If you use a non-default name, such as “InputSignal” or “OutputData,” the name will appear.
To make the subsystem displays the actual block names, you can change ShowPortLabels to FromPortBlockName. This forces the subsystem to use the block names regardless of the port icon setting. Alternatively, you can rename the ports to something other than the default names.
set_param(gcb, 'ShowPortLabels','FromPortBlockName');
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Subsystems dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!