Contenido principal

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, catchEjecutar instrucciones y detectar los errores resultantes
MExceptionCapture error information
addCauseRecord additional causes of exception
addCorrectionProvide suggested fix for exception
getReportGet error message for exception
MException.lastReturn last uncaught exception
rethrowRethrow previously caught exception
throwThrow exception
throwAsCallerThrow exception as if occurs within calling function
matlab.lang.correction.AppendArgumentsCorrectionCorrect error by appending missing input arguments
matlab.lang.correction.ConvertToFunctionNotationCorrectionCorrect error by converting to function notation
matlab.lang.correction.ReplaceIdentifierCorrectionCorrect error by replacing identifier in function call

Temas