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

1 view (last 30 days)
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 Comment
Vivek Jadye
Vivek Jadye on 20 Apr 2016
Can you please add a specific example? It would be helpful in understanding the findobj behavior that you are seeing.

Sign in to comment.

Answers (1)

Walter Roberson
Walter Roberson on 20 Apr 2016
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.

Categories

Find more on Migrate GUIDE Apps in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!