1. findobj has changed! How can I get it behave like it did in 2013?

1 次查看(过去 30 天)
Running 2015 version, and 'findobj' behaves completely differently than in 2013. It used to return handles only, now it returns a matrix. ALSO, openfig used to open with a handle - now if you use openfig and then findobj, the handle (number as it's now called) is EMPTY! HELP!
  1 个评论
Vivek Jadye
Vivek Jadye 2016-4-20
Can you please add a specific example? It would be helpful in understanding the findobj behavior that you are seeing.

请先登录,再进行评论。

回答(1 个)

Walter Roberson
Walter Roberson 2016-4-20
findobj returns as many objects as it locates, under its search rules.
One thing to keep in mind is that as of R2014b, more graphics objects switched to have HandleVisibility 'callback' or 'off'. findobj() does not find those objects even if they are direct parameters, because findobj() is restricted to visible handles (those whose handle visibility is 'on', always, together with those whose handle visibility is 'callback' if you are calling findobj within a callback.) findall() is what is needed to search for all handles.
If multiple accessible handles are located then findobj will return them. Multiple handles may be located if there are multiple objects with the same properties. That can happen for objects in .fig files or in the GUIDE handles structure if you multiple instances exist.

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by