Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.



Using figure handles outside of function in which they're defined
Posted:
Feb 7, 2013 11:46 AM


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



