- `ERR = lasterror ()`
- `lasterror (ERR)`
- `lasterror ("reset")`

Query, set, or reset the last error structure.

The error structure contains fields describing the message, identifier, and
stack associated with the most recent error.

See also: `error`, `rethrow`, `lastwarn`.

### References

- https://www.mathworks.com/help/matlab/ref/lasterror.html
- https://octave.sourceforge.io/octave/function/lasterror.html
