# clear

Remove variable from workspace.

## Syntax

* clear
* clear variable\_name
* clear global
* clear all
* clear mex
* clear variables
* clear functions
* clear function\_name
* clear mexfunction\_name
* clear variable\_name\_1 ... variable\_name\_N
* clear global variable\_name

## Input argument

* variable\_name - a string: variable name.
* global - clears all global variables.
* all - clears all variables in all scopes
* mex - clears all mex functions in all scopes
* variables - clears all variables in current scope.
* functions - clears cache of macros functions and associated persistent variables.
* function\_name - clears persistent variables of a function.
* mexfunction\_name - clears mex function (see mexAtExit).

## Description

**clear** is used to remove variable given by its name.

**clear** can also delete handle object if a function handle\_TYPE\_clear is defined.

## Example

```matlab
A = 3;
who
clear A
who
A
```

## See also

[who](who).

## History

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

## Author

Allan CORNET
