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일

2 개 추천

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일

0 개 추천

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.

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

제품

질문:

2014년 11월 12일

댓글:

2022년 11월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by