Advanced Evaluation and Exception Handling
MATLAB® includes functionality to indirectly evaluate expressions and to collect data about errors.
Any MATLAB code that detects an error and throws an exception constructs
an MException object. MATLAB can throw either predefined exceptions or exceptions that you
construct.
Functions
Topics
- Alternatives to the eval Function
Although the
evalfunction is very powerful and flexible, it is not always the best solution to a programming problem. In many instances, there are recommended alternative approaches to usingeval. - Exception Handling in a MATLAB Application
It is a good programming practice to include error checking in your programs to ensure reliable operation under all conditions. You can decide how your programs respond to different types of errors.