I am trying to use the TRY/CATCH blocks with an identifier and use the LASTERR command in the CATCH block. In such a case, the LASTERR seems to grab the error that occured before the TRY/CATCH blocks. An example code situation would be to first execute :
imread('foo')
Now, execute the following:
try fdfscatch ME lasterrend
I would expect the LASTERR command to grab the error due to the 'fdfs' statement, but it seems to throw to IMREAD error that occured before executing this TRY/CATCH block.
Best Answer