Hi everyone,
I have a tricky question 🙂 I use evalc to call a function (which is not mine and which I don't to modify). But sometimes this function throws an error.
My problem is that the error message sent by this function is not explicit at all and all the details are in some text output before the error. And since I am in evalc I don't see these outputs. Is there a way of displaying that ?
small exemple :
- the function that I can not to modify
function blackbox() disp('explicit explanation'); error('see above');end
- my function
function my_code() try T = evalc('blackbox()'); catch error(['oops: ' T]); endend
What I want is for my_code() to display 'explicit explanation'. But of course if I do what I wrote above, the T is undefined (because evalc/blackbox throwed an exception)
thanks for your help !
update: maybe it was not clear enough: but what I want is to get all the messages that were supposed to be displayed by the function that returned the error … and I can't find that in the ME …. In the example above, I want to be able to display 'explicit explanation'
Best Answer