Hi,
I understand that you want to change one port label dynamically while keeping the other labels unchanged. The issue is, when you use “port_label” inside the “Icon Drawing Commands”, it overrides all existing port labels rather than modifying them. So, on specifying the “port_label” command for just one port, Simulink will not display the other port labels.
To fix this, you can specify all port labels in the “Icon Drawing Commands” in the mask editor.
For example, if you have 3 input ports and 1 output port and you want to keep the first input port’s label dynamic, you can use the following code inside “Icon Drawing Commands”:
label1 = get_param(gcb, 'port1_label');
port_label('input', 1, label1);
port_label('input', 2, 'b');
port_label('input', 3, 'c');
port_label('output', 1, 'y');
This will ensure that when you change the first port's label dynamically, the other port labels remain visible.
Here is a sample output of the above code for your reference:
Thanks!