How can I add a block to a Simulink model in the center of the model view?

조회 수: 4 (최근 30일)
S. Boopalam
S. Boopalam 2019년 10월 7일
댓글: Artur Kaminski 2020년 5월 14일
I can add a block to a model using the add_block, but I also want to change the Position parameter of the block to be approximately in the middle of the model. What commands can I use to get the coordinates for the center of the model viewing area?

답변 (1개)

Jesús Zambrano
Jesús Zambrano 2020년 1월 1일
Hi S. Boopalam,
Once you hav place the vlock using the command add_block, you can change the position of the block using the command set_param. For example:
vdp
set_param('vdp/Fcn','Position',[50 100 110 120])
To check the coordinates for the center of the model, you can place the block in the center an use the command get_param. For example:
get_param('vdp/Fcn','Position')
Hope this can help to solve your question.
  댓글 수: 1
Artur Kaminski
Artur Kaminski 2020년 5월 14일
You mean to find out where center is, you have to first manually put a block in the model, and then use get_param on the block to see the position, which would be center? What if I want to find center automatically?

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

카테고리

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

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by