Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

getenv

Environment variable

Syntax

value = getenv(name)

Description

example

value = getenv(name) searches the operating system environment variable list for text of the form name=value.

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 starting MATLAB from Terminal.

Examples

collapse all

res = getenv('SYSTEMROOT')
res = 'C:\windows'

Input Arguments

collapse all

Environment variable name, specified as a character vector.

Example: 'PATH'

Output Arguments

collapse all

Environment variable value, returned as a character vector. If name is not found, then MATLAB returns an empty matrix.

See Also

| | | |

Introduced before R2006a

Was this topic helpful?