필터 지우기
필터 지우기

change the position of a part of the input ports of a simulink block.

조회 수: 217 (최근 30일)
Hello everyone,
I would like to change the position of the input ports of a simulink block. I need to put them on the bottom of a subsystem block. Does anyone have any ideas for how I can put the input ports on more than one side?
Actually I tried to modify the parameter "port connectivity", but at any attempt I get an error message saying:
*' ModelReference block parameter 'PortConnectivity' is read-only '*
This is the list of instructions that I used "
portData = get_param('ModelName/MySubsystemBlockName','PortConnectivity');
portData(1).Position = [newXValue newYValue];
set_param('ModelName/MySubsystemBlockName','PortConnectivity',portData); "
I'm wondering why we have that option, "PortConnectivity", in the parameters list of a Simulink block: http://www.mathworks.nl/help/toolbox/simulink/slref/f23-7517.html if we cannot use it, and in particular in which cases we have a Simulink block where this option is write permitted?
Any help?
thanks in advance
  댓글 수: 2
Karansingh Patil
Karansingh Patil 2018년 4월 9일
The input/output ports can be flipped in a simple manner. Select the block, right click on it and then select option Rotate and Flip, and chose the option Flip Block. Thus it flips the input/output ports.

댓글을 달려면 로그인하십시오.

채택된 답변

Kaustubha Govind
Kaustubha Govind 2012년 3월 12일
AFAIK, it is currently not possible to change the positions of input/output ports on a Simulink block. The best you can do it Rotate/Flip your block, but the relative positions of the ports will be unchanged.
  댓글 수: 3
Mikhail Slepchenkov
Mikhail Slepchenkov 2021년 4월 20일
Is this answer still correct as of 2020? I believe in 2020b, at most, you can drag and position the ports at the subsystem's parent level. Please update or remove answer.
Ahmet Samil Mazlum
Ahmet Samil Mazlum 2021년 5월 14일
I can confirm Mikhail that in 2020b, you can freely drag the ports of a subsystem block to any side.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Alaa Salaheldin
Alaa Salaheldin 2015년 4월 18일
Double click on the input port itself to change its location from right to left using the "Port location on parent subsystem" attribute, after that you may flip your block vertically so the input port would be on the lower side of your block.
  댓글 수: 3
Simon Geoffroy-Gagnon
Simon Geoffroy-Gagnon 2018년 5월 9일
Hello,
Is there a way to change the location of the port on the parent subsystem programmatically?
Thank you,
Elisaia Junior Kolia
Elisaia Junior Kolia 2018년 5월 12일
Hello guys, Is anyone here know how to change from input conn to output? I don't know if its just norm but i have only the input conn on the simEvent port and subsystem library. Please

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 General Applications에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by