How to rearrange subsystem block ports?
21 ビュー (過去 30 日間)
古いコメントを表示
I would like to rearrange the input ports of my subsystem block (attached image) from:
- Servo3_cmd
- Servo2_cmd
- Sevo1_cmd
- MachEnv_setup
to:
- Servo3_cmd
- Servo2_cmd
- MachEnv_setup
- Servo1_cmd
Is rearranging the input/output ports of a simulink block possible?
Thank you!
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/146269/image.png)
NB : If anyone is interested, I found a better way to rearrange the ports. You go into the subsystem PMIO block and you set the port number and port position (Left/Right), which rearranges the inputs :)
0 件のコメント
採用された回答
Azzi Abdelmalek
2014 年 11 月 29 日
Use this code to get the different ports then use delete_line and add_line to arrange them
b=get_param('untitled/yoursubsystem','PortConnectivity')
n=numel(b) % number of blocks connected to block1;
out={};
for k=1:n
s=get(b(k).SrcBlock); % search for source blocks
if ~isempty(s)
out(end+1,1)={'Source'}
out{end,2}=s.BlockType;
out{end,3}=s.Name
end
end
7 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Programmatic Model Editing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!