MATLAB Function Reference Previous page   Next Page
catch

Specify how to respond to error in try statement

Description

The general form of a try statement is

Normally, only the statements between the try and catch are executed. However, if an error occurs during execution of any of the statements, the error is captured into lasterr, and the statements between the catch and end are executed. If an error occurs within the catch statements, execution stops unless caught by another try...catch block. The error string produced by a failed try block can be obtained with lasterr.

See Also

try, end, lasterr, eval, evalin


Previous page  cat caxis Next page

© 1994-2005 The MathWorks, Inc.