Gestión de excepciones
Capture datos sobre errores
Cualquier código de MATLAB® que detecte un error y genere una excepción crea un objeto MException
. MATLAB puede generar excepciones predefinidas o excepciones que usted cree.
Funciones
try, catch | Ejecutar instrucciones y detectar los errores resultantes |
MException | Capture error information |
addCause | Record additional causes of exception |
addCorrection | Provide suggested fix for exception |
getReport | Get error message for exception |
MException.last | Return last uncaught exception |
rethrow | Rethrow previously caught exception |
throw | Throw exception |
throwAsCaller | Throw exception as if occurs within calling function |
matlab.lang.correction.AppendArgumentsCorrection | Correct error by appending missing input arguments |
matlab.lang.correction.ConvertToFunctionNotationCorrection | Correct error by converting to function notation |
matlab.lang.correction.ReplaceIdentifierCorrection | Correct error by replacing identifier in function call |
Temas
- 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.