How to get an ouput of a function in a try block ?
이전 댓글 표시
Hello !
I have the following function:
try
h = MyFunction(arg1,arg2);
catch
close(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.
채택된 답변
추가 답변 (2개)
David Young
2011년 11월 30일
0 개 추천
Open the window first, and pass it as an argument to MyFunction.
카테고리
도움말 센터 및 File Exchange에서 Sources에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!