unsetenv
Removes an environment variable from the current process.
Category: Environment and Settings > System Commands
Syntax
unsetenv(name)
Deletes the variable name from the process environment.
Description
After the call isenv(name) is false and getenv(name) returns an empty character vector. Programs started afterwards with system no longer see the variable. Only the current process is changed.
Input arguments
name- Variable name.
Example
Create and remove
setenv('TMP_DEMO', '1');
disp(isenv('TMP_DEMO'))
unsetenv('TMP_DEMO');
disp(isenv('TMP_DEMO'))
disp(isempty(getenv('TMP_DEMO')))
Output
1
0
1