MATLAB® ловит исключения, брошенные Python® и преобразует их в matlab.exception.PyException объект, который получают из MException класс. Для примера:
try py.list('x','y',1) catch e e.message if(isa(e,'matlab.exception.PyException')) e.ExceptionObject end end
ans =
Python Error: TypeError: list() takes at most 1 argument (3 given)
ans =
Python tuple with no properties.
(<type 'exceptions.TypeError'>, TypeError('list() takes at most 1 argument (3 given)',), None)
Если MATLAB отображает сообщение об ошибке следующего формата, обратитесь к документации на Python.
Python Error: Python class: message