How do I connect multiple input and output ports using a single ADD_LINE function call in Simulink 6.5 (R2006b)?
15 次查看(过去 30 天)
显示 更早的评论
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.
采纳的回答
MathWorks Support Team
2009-6-27
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Sources 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!