필터 지우기
필터 지우기

Simulink : Get handle of a Matlab-Function block, inside Matlab-Function itself

조회 수: 2 (최근 30일)
Hello,
Is there a way to get handle of a Matlab-Function Simulink block inside of the Matlab-Function itself?
Thanks!

채택된 답변

Fangjun Jiang
Fangjun Jiang 2020년 2월 20일
I would think so, just try handle=get_param(Block,'handle') where "Block" is the full path of the MATLAB function block in your Simulink model.
  댓글 수: 3
Fangjun Jiang
Fangjun Jiang 2020년 2월 20일
would you try to see if "gcb" could always give you the correct path?
langrg
langrg 2020년 2월 21일
It works! I thougth that 'gcb' would change each time I select a bloc in Simulink, but in fact when it's used in Matlab-Function it always gives back Matlab-Function path.
I'm going to accept your answer and write solution in capital here:
USE "gcb" IS THE GOOD SOLUTION!
Thank you very much!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Programmatic Model Editing에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by