How do I connect multiple input and output ports using a single ADD_LINE function call in Simulink 6.5 (R2006b)?
15 views (last 30 days)
Show older comments
I have two blocks in my model. Block 1 has 5 output ports and block 2 has 5 input ports. I would like to connect all five ports (outport 1 to inport1, outport 2 to inport 2, etc) with one call of ADD_LINE.
Accepted Answer
MathWorks Support Team
on 27 Jun 2009
To connect multiple input output ports using a single call to the ADD_LINE function, you can specify the ports to be connected in a cell array and then call the function with these cell arrays. A short example is shown below:
output = {'Block1/1','Block1/2','Block1/3','Block1/4','Block1/5'};
input = {'Block2/1','Block2/2','Block2/3','Block2/4','Block2/5'};
add_line(gcs,input,output)
0 Comments
More Answers (0)
See Also
Categories
Find more on Sources 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!