# error

Raise an error message.

## Syntax

* error(id, msg)
* error(msg)
* error(error\_structure)

## Input argument

* id - a string: error identifier.
* msg - a string.
* error\_structure - error message structure.

## Description

**error** stops the current script execution.

**error('')** will be ignored and the script will continue to run.

identifier includes one or more component fields and a mnemonic field (example: 'nelson:matrix:empty')

## Examples

```matlab
error('your error message.')
error('nelson:identifier', 'your error message.')

error('')
```

```matlab
1 / [1 2 3]
a = lasterror()
lasterror('reset')
b = lasterror()
error(a)
c = lasterror()
```

## See also

[MException](mexception), [lasterror](lasterror), [warning](warning).

## History

| Version | Description     |
| ------- | --------------- |
| 1.0.0   | initial version |

## Author

Allan CORNET
