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

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

Description

getenv 'name' searches the underlying operating system environment list for text of the form name=value, where name is the input character vector. If found, MATLAB® returns the character vector 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 starting MATLAB from Terminal.

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

Examples

os = getenv('OS')
os =
Windows_NT

See Also

| | | |

Introduced before R2006a

Was this topic helpful?