Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: cla clearing handles from the wrong axis
Replies: 9   Last Post: Feb 25, 2013 4:01 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Scott

Posts: 13
Registered: 10/31/12
Re: cla clearing handles from the wrong axis
Posted: Feb 24, 2013 2:31 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <kgcns6$ds9$1@newscl01ah.mathworks.com>...
> "Scott" wrote in message <kgcfgf$mbu$1@newscl01ah.mathworks.com>...
>

> > When I do this, it does exactly what it is supposed to do for the second figure, but it also, somehow, changes the array of patch handles for the main GUI window too. Suddenly, many of them are no longer valid handles which messes up downstream GUI functions. (before, a call to ishandle for the handles array gives all 1s. After, there are strings of 0s).
>
> I think you confuse: MATLAB does not change the handles of patches, it actually left unchanged those patches, which is no longer exist since you clear the axes.
>
> You need to manage those handles coherently (using GUIDATA function, for example). It's your job to do so, MATLAB won't do it for you.
>
> Bruno


My language was imprecise. I cleared the axes of the axes on the 2nd figure. But I explicitly specified that axis:

cla(axis_figure2,'reset')

So it shouldn't touch any handles of patches that are associated with the primary axis, or so I would assume.

And yet, I have an array of 500 or so handles to patch objects that are all children of the primary axis. If I do:

disp(ishandle(primaryAxisHandles_array)')
cla(axis_figure2,'reset')
disp(ishandle(primaryAxisHandles_array)')


I get output like the following:

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 (for the first disp())
0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 (for the 2nd disp()

the important thing is that these handles should (or at least I'd like them to) have nothing at all to do with the axis_figure2



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.