tf = isenv(env_name)
| Parameter | Description |
|---|---|
| env_name | string scalar, character vector, string array, cell array of character vectors: environment variable name. |
| Parameter | Description |
|---|---|
| tf | logical: true if the environment variable is defined, false otherwise. |
isenv returns true if the environment variable env_name is defined in the current process environment, even when its value is empty.
If env_name is a nonscalar string array or cell array of character vectors, then tf has the same dimensions as env_name.
setenv('MY_ENV_VAR', 'funvalue')
isenv('MY_ENV_VAR')
isenv('A_VARIABLE_THAT_DOES_NOT_EXIST')
isenv(["MY_ENV_VAR", "A_VARIABLE_THAT_DOES_NOT_EXIST"])
| Version | Description |
|---|---|
| 2.0.0 | initial version |