Explanation

Before MATLAB supported try and catch blocks, you could use evalin with two arguments to obtain some of the same functionality. In most cases, try/catch blocks are much faster.


Suggested Action

Convert evalin('base' 'foo', 'fclose(fid)') to:

try
  foo
catch ME
  fclose(fid)
end

To match the behavior specified by 'base', the replacement code should be called outside of a function. To match the behavior specified by 'caller', the replacement code should be placed inside the desired function.

For more information and examples, see The try/catch Statement.