필터 지우기
필터 지우기

Get selected objects (simulink)

조회 수: 63 (최근 30일)
Adrian
Adrian 2014년 11월 12일
댓글: Joe Rustan 2022년 11월 3일
Hi, when I want to run a script on a selected simulink object, I use "gca" to get its handle. If I select many objects, "gca" return only the last selected. Ho can I get handles of ALL selected objects?
Thanks Adriano

채택된 답변

Orion
Orion 2014년 11월 12일
Hi,
gca won't return the selected object, but the current axe in a figure (get current axe)
I guess you meant gcb (get current block).
gcb only return one block.
if you want multiple blocks :
MyBlocks = find_system(gcs,'Selected','on')
  댓글 수: 1
Adrian
Adrian 2014년 11월 13일
Yes I wanted to say gcb. Thank you. It works perfectly!

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

추가 답변 (1개)

Gaganjyoti Baishya
Gaganjyoti Baishya 2020년 6월 21일
To get an array of all selcted blocks use find_system(bdroot, 'Selected', 'on');
  댓글 수: 1
Joe Rustan
Joe Rustan 2022년 11월 3일
Is there a way to get just the currently selected signal line coming from/to a block? Thanks.

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

카테고리

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