The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Problem with handles and continually updating plot in GUIDE
Replies: 5   Last Post: Aug 13, 2014 9:46 AM

Advanced Search

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

Posts: 2,237
Registered: 9/26/13
Re: Problem with handles and continually updating plot in GUIDE
Posted: Aug 13, 2014 9:46 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Alex " <> wrote in message
> Actually, it seems this is part of the same problem. How would I update
> the listener
> handles.sliderListener =
> addlistener(handles.slider1,'ContinuousValueChange', ...
> @(hObject, event)
> slider1ContValCallback(...
> hObject, eventdata, handles));

You are still passing the COPY of the handles structure into
slider1ContValCallback. NO changes you make ANYWHERE to the handles
structure will change the copy being remembered by that anonymous function.
You can delete the handles structure entirely, and it WILL NOT CHANGE the
listener's copy.

If you want slider1ContValCallback to get the most up-to-date copy, retrieve
it INSIDE slider1ContValCallback instead of passing it into
slider1ContValCallback via anonymous function.

It's like you have a nametag labeled Bob attached to your chest by surgical
staples. You can change your name from Bob to whatever else you want -- but
people are going to look at that nametag and call you Bob. Instead of doing
that, let people ask you your name when they meet you. [Not a great
metaphor, but close enough.]


Steve Lord
To contact Technical Support use the Contact Us link on

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

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.