[Fix Inport position][Simulink Model]

Hello EveryOne,
I have a problem, please spend on your time to help me.
In matlab simulink, I would like to fix the Inport's position,
Even when I add or remove a Inport block, the previous others Inport's position are not changed.
Thank you in advance.

답변 (1개)

Nikhil Kori
Nikhil Kori 2020년 7월 9일
편집: Nikhil Kori 2020년 7월 9일

0 개 추천

Hi,
To change the position of inport block you are supposed to use get_param and set_param.
block_size = get_param('model_name/block_name','Position');
X = block_size(1,1);
Y = block_size(1,2);
X + Width = size_blk(1,3);
Y + Height = size_blk(1,4);
set_param('model_name/block_name','Position',[X Y X+Width Y+Height]);
for example :-
set_param('vdp/Fcn','Position',[50 100 110 120])
You can refer to this link for more information set_param.

댓글 수: 1

Binh Huynh Thanh
Binh Huynh Thanh 2020년 7월 11일
Thank you Nikhil Kori,
But when we remove a inport block in the simulink model then, others inport's position are automatically changed, right ? I would like to keep that position number without set_param again.

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

카테고리

도움말 센터File Exchange에서 Programmatic Model Editing에 대해 자세히 알아보기

질문:

2020년 7월 9일

댓글:

2020년 7월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by