Get selected objects (simulink)

32 次查看(过去 30 天)
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 个)

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 中查找有关 Simulink Functions 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by