Change port numnber set_param('In1', 'Port', 8)
Show older comments
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.
Answers (1)
Fangjun Jiang
on 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 Comments
Kaustubha Govind
on 28 Nov 2011
I think Simulink takes care of duplicated port numbers by re-ordering the other port numbers.
Fangjun Jiang
on 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.
Categories
Find more on String in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!