Change port numnber set_param('In1', 'Port', 8)

Hello,
is it possible to change the number of the port? I've tried set_param('In1', 'Port', 8) but I get the Error
"Invalid setting in Outport block 'In1' for parameter 'Port'"
Changing the number in the dialog does work, so is there a way to change it in the command line?
Thanks a lot.

Réponses (1)

Fangjun Jiang
Fangjun Jiang le 27 Nov 2011
You need to use the full path of the block and set string format for the port number. Also, you might need to consider duplicated port number.
f14;
set_param('f14/Nz Pilot (g)','port','5');

2 commentaires

Kaustubha Govind
Kaustubha Govind le 28 Nov 2011
I think Simulink takes care of duplicated port numbers by re-ordering the other port numbers.
Fangjun Jiang
Fangjun Jiang le 28 Nov 2011
Yes. What I meant was to be careful. Changing a port number from 1 to 8 might affect the existing port number 8, if it exists.

Connectez-vous pour commenter.

Tags

Question posée :

le 27 Nov 2011

Community Treasure Hunt

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

Start Hunting!

Translated by