returns the value of the operating system environment variable
val = getenv(
name as a character vector. If
does not exist, then
getenv returns an empty character
On UNIX® platforms, the shell you use to start MATLAB® determines the operating system environment. For example, on a
Mac platform, starting MATLAB from the
Applications folder creates an environment
that is different from that created by starting MATLAB from Terminal.
Display System Root Directory on Windows
res = getenv("SYSTEMROOT")
res = 'C:\windows'
name — Environment variable name
string scalar | character vector
Environment variable name, specified as a string scalar or character vector.
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Run code in the background using MATLAB®
backgroundPool or accelerate code with Parallel Computing Toolbox™
This function fully supports thread-based environments. For more information, see Run MATLAB Functions in Thread-Based Environment.
Introduced before R2006a