getenv

Environment variable

Syntax

getenv 'name'
N = getenv('name')

Description

getenv 'name' searches the underlying operating system environment list for a string of the form name=value, where name is the input string. If found, MATLAB® returns the string value. If the specified name cannot be found, an empty matrix is returned.

On UNIX® platforms, the shell you use to start MATLAB determines the operating system environment. For example, starting MATLAB on a Mac platform from the Applications folder creates a different shell environment from launching MATLAB from Terminal.

N = getenv('name') returns value to the variable N.

Examples

os = getenv('OS')
os =
Windows_NT

See Also

| | | |

Was this topic helpful?