帮助中心帮助中心
本页翻译不是最新的。点击此处可查看最新英文版本。
环境变量
val = getenv(name)
示例
val = getenv(name) 以字符向量形式返回操作系统环境变量 name 的值。如果 name 不存在,则 getenv 返回空字符向量。
val
name
getenv
在 UNIX® 平台上,您用于启动 MATLAB® 的 shell 确定操作系统环境。例如,在 Mac 平台上,从 Applications 文件夹启动 MATLAB 后创建的环境不同于从终端启动 MATLAB 所创建的环境。
Applications
全部折叠
res = getenv("SYSTEMROOT")
res = 'C:\windows'
环境变量名称,指定为字符串标量或字符向量。
示例: "PATH"
"PATH"
backgroundPool
ThreadPool
此函数完全支持基于线程的环境。有关详细信息,请参阅Run MATLAB Functions in Thread-Based Environment。
在 R2006a 之前推出
isenv | setenv | unsetenv | computer | pwd | ver | path
isenv
setenv
unsetenv
computer
pwd
ver
path
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office