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: Using figure handles outside of function in which they're defined
Replies: 1   Last Post: Feb 7, 2013 12:37 PM

Advanced Search

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

Posts: 3
Registered: 7/1/11
Using figure handles outside of function in which they're defined
Posted: Feb 7, 2013 11:46 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi all,
Here's what I'm attempting...
1) I define a figure handle 'h=plot(x,y)' in one function.
2) I declare 'h' as global
3) I recall this 'h' in a different function, trying to use it with 'copyobj(h,handles.axes1)' where axes1 is a different axes than where 'h' was originally plotted.

I get an error with copyobj, that 'h' is an invalid handle.

As a check, I tried using the copyobj command, similarly, but within the first function where 'h' was originally defined. And that works just fine.

Am I to understand that I cannot use figure handles this way, declaring them as globals, between multiple functions? Is there a way around this?
Thanks all!

Chaitanya



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.