I am looking for an elegant way to use a conditional statement try catch.
I assume it might look something like this:
tryif loose==1
% Do something, like loading the user preferences
catch %Or catchif?
% Hande it
end
So far, I know that you can use blocks try catchto make your compiled code run, but make it stop in a debugging session using dbstop if caught error. Now I'm basically looking for the opposite:
Usually I want the code to stop if unforeseen situations arise (to guarantee the integrity of the results), but you want to be less strict on some things, sometimes when I debug.
source
share