Main Content

指定 userpath 作为启动文件夹(MacintoshUNIX

此示例展示如何在 Macintosh 平台上将 userpath 文件夹指定为启动文件夹。对于 UNIX® 平台而言,此过程大体相同。假设在 Macintosh 平台上将 userpath 设置为默认值,其中 smith 为主文件夹。

使用 bash shell 设置 MATLAB_USE_USERWORK 环境变量,以便将 userpath 用作启动文件夹。

export MATLAB_USE_USERWORK=1

在该 shell 中,启动 MATLAB®。接下来,在 MATLAB 中验证当前文件夹。

pwd
/Users/smith/Documents/MATLAB

确认该文件夹与针对 userpath 定义的文件夹相同。

userpath
/Users/smith/Documents/MATLAB;

确认 userpath 位于搜索路径的最前方。

path
/Users/smith/Documents/MATLAB
/Users/smith/Applications/MATLAB/R2009a/toolbox/matlab/general
/Users/smith/Applications/MATLAB/R2009a/toolbox/matlab/ops

...