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

 Akzeptierte Antwort

Orion
Orion am 12 Nov. 2014

2 Stimmen

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 Kommentar

Adrian
Adrian am 13 Nov. 2014
Yes I wanted to say gcb. Thank you. It works perfectly!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Gaganjyoti Baishya
Gaganjyoti Baishya am 21 Jun. 2020

0 Stimmen

To get an array of all selcted blocks use find_system(bdroot, 'Selected', 'on');

1 Kommentar

Joe Rustan
Joe Rustan am 3 Nov. 2022
Is there a way to get just the currently selected signal line coming from/to a block? Thanks.

Melden Sie sich an, um zu kommentieren.

Produkte

Gefragt:

am 12 Nov. 2014

Kommentiert:

am 3 Nov. 2022

Community Treasure Hunt

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

Start Hunting!

Translated by