I have a GUI in which I have a button create a plot: p(1)=plot(…).
I have a reset button that, upon being pressed, executes close(p).
When I hit the reset button, I get the error:
??? Error using ==> close at 94Invalid figure handle.Error in ==> Pulse>reset_Callback at 870close(p)
However, while the GUI and p(1) plot figure are open, if I type close(p) in the Matlab Command Window, it closes the figure without any errors. Any idea what's causing this?
Best Answer