I have the following function:
tryh = MyFunction(arg1,arg2);catchclose(h);end
Unfortunately it doesn't run because if an error occurs in MyFunction, ouput h isn't in the workspace of the main function. Yet, h is set in MyFunction before the error occurs.
How can I close a window opened by MyFunction, with the handle h, if an error occurs in MyFunction ?
Thank you for your help.