setenv
Set environment variable
Syntax
Description
setenv(
sets the value of an operating system environment variable. Ifname
,value
)name
exists as an environment variable, thensetenv
replaces its current value withvalue
. Ifname
does not exist, thensetenv
creates an environment variable calledname
and assignsvalue
to it.
setenv
passesname
andvalue
to the operating system unchanged. Special characters, such as;
,/
,:
,$
, and%
, are unexpanded and intact invalue
.
A process spawned using the MATLAB®system
,unix
,dos
, or!
function reads the values assigned to variables using thesetenv
function. You can retrieve any value set withsetenv
by callinggetenv(
.name
)
setenv(
assigns a null value toname
)name
. This syntax is equivalent tosetenv(name,'')
. On the Microsoft®Windows®platform, this syntax is equivalent to undefining the variable. On most UNIX®platforms, it is possible to have an environment variable defined as empty.