|
"Leo Simon" <leosimon@berkeley.edu> wrote in message <judbfv$ksu$1@newscl01ah.mathworks.com>...
> I'd like to be able to do the following, from within a function: exit the function and *after exiting* go into keyboard mode. For example, if an error occurs within a function call, I'd like to be able to get back to the caller workspace *before* keyboarding. This seems to me to be impossible in matlab, but maybe somebody else knows how to do this...
From what I understand, you would like to catch the error that occurs in your function and handle said error in the caller workspace. Wrap it around a TRY-CATCH statement:
try
myfunc(a,b,c,d); % call the function
catch ME
disp(ME); % display the error
% do what you like here.
end
If you're just trying to debug, you can always keyboard from wherever and use DBUP, which will place the keyboard in the caller function....
Hope this helps!
|