clear
Obliterates variable(s) from memory in the current session of the application.
Syntax
clear
clear global
clear(x)
Inputs
- global (optional)
- Argument which will obliterate all global variables from memory.
- x (optional)
- Name of the variable to obliterate. This can also contain a wildcard pattern '*', which will obliterate all variables matching the pattern.
Examples
global globalVariable;
testInteger = 24;
testString = 'This is a test string';
clear
whoNo variables in current scope in call to function who at line number 1global globalVariable;
testInteger = 24;
testString = 'This is a test string';
clear global
whoVariables in current scope:
testInteger
testStringglobal globalVariable;
testInteger = 24;
testString = 'This is a test string';
clear('testInteger')
whoVariables in current scope:
globalVariable
testStringglobal globalVariable;
testInteger = 24;
testString1 = 'This is string 1';
testString2 = 'This is an example for the command clear';
clear('*ring*')
whoVariables in current scope:
globalVariable
testIntegerComments
If no arguments are passed, all variables are obliterated from memory. If an optional argument, global, is passed, only global variables are obliterated from memory. If an optional argument x is passed, the variable associated with the name x will be obliterated. x may also contain a wildcard pattern '*', which will obliterate all variables with names matching the wildcard pattern from memory.