MATLAB Function Reference | Search  Help Desk |
try | See Also |
The general form of a
try
statement is:
try
statement, ..., statement, catch
statement, ..., statement end
Normally, only the statements between the try
and catch
are executed. However, if an error occurs while executing 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
.
catch
, end
, eval
, evalin
,