<< createGUID | OS functions | hostname >> |
s = getenv(env_name) |
string scalar, character vector, string array, cell array of character vectors: environment variable name.
string scalar, character vector, string array, cell array of character vectors: the environment variable value.
getenv returns the value of an environment variable if it exists.
If the environment variable does not exist, it will return ''.
If env_name is a nonscalar cell array of character vectors or string array, then val has the same dimensions and type as env_name.
If env_name is a string scalar, then s is a character vector.
getenv('OS')
getenv('myenvvar')
getenv(["PATH"; "OS"])
getenv({'PATH'; 'OS'})
Version | Description |
---|---|
1.0.0 | initial version |
1.4.0 | Retrieve the values of several environment variables. |
Allan CORNET