필터 지우기
필터 지우기

Get Simulink Block name from Callback function

조회 수: 1 (최근 30일)
Arun
Arun 2013년 8월 2일
In Simulink, is there any way to get the name of the block whose callback function is invoked, from within the function itself? Some functionality similar to the 'this' pointer in C++?

채택된 답변

Arun
Arun 2013년 8월 2일
I figured out that it was possible to do this using the "gcb" handle. So for getting the block's full name, all I had to do was:-
dev = sprintf('%s/%s',get_param(gcb, 'Parent'), get_param(gcb, 'Name'))
Hope this helps anyone else stuck with the same problem as I was.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Model, Block, and Port Callbacks에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by