FUNCTION REFERENCE

MException

Create an exception with an identifier, message, cause list and stack.

Create an exception with an identifier, message, cause list and stack.

Syntax

exception = MException(identifier, format, arguments...)

A caught error's stack lists the function frames where it was raised, innermost first, ending with 'submitted source'; an error raised at top level has an empty 0x1 stack. The exception is not a structure: isstruct is false and its properties (identifier, message, stack, cause) are read-only.

Example

e=MException('pkg:id','Value %d',5); e.message   % Value 5

Differences from MATLAB: Uses tagged structure storage; stack file names and line numbers are not tracked.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.