msg = lasterr()
[msg, id] = lasterr()
previous = lasterr(msg)
previous = lasterr(msg, id)
| Parameter | Description |
|---|---|
| msg | error message: character vector or string scalar. |
| id | error identifier: character vector or string scalar. |
| Parameter | Description |
|---|---|
| msg | last error message: character vector. |
| id | last error identifier: character vector. |
msg = lasterr() returns the message of the last recorded error.
[msg, id] = lasterr() also returns the error identifier.
lasterr(msg) and lasterr(msg, id) set the last error message (and identifier), returning the previous message.
try
error('MyPkg:boom', 'exploded');
catch
end
[msg, id] = lasterr()
| Version | Description |
|---|---|
| 2.0.0 | initial version |