更改当前文件夹
CD(新手)
OldFolder = CD(NewFolder)
光盘
光盘(
将当前文件夹更改为新建文件夹
)新建文件夹
。
OldFolder = CD(NewFolder)
将现有当前文件夹作为字符串返回到OldFolder
,然后将当前文件夹更改为新建文件夹
。
光盘
显示当前文件夹。
|
指定要更改当前文件夹的文件夹的字符串。有效值可以是以下任何一个:
|
|
A string specifying the current folder that was in place when you issued the |
The current folder is a reference location that MATLAB®用于查找文件。这个文件夹有时称为current directory,,,,当前的工作文件夹, 或者目前的工作目录。
采用光盘
with thematlabroot
将当前文件夹更改为MATLAB的当前运行版本的示例目录:
CD(FullFile(Matlabroot,'/help/techdoc/matlab_env/示例')
在微软®Windows®平台,指定将当前文件夹从任何位置更改为MATLAB版本7.11(R2010B)的示例目录的完整路径,假设版本已安装在您的C:
驾驶:
cd(“C: /程序文件/ MATLAB / R2010b /帮助/ techdoc / matlab_env/examples') % Change the current folder from % C:/Program Files/MATLAB/R2010b/help/techdoc/matlab_env/examples to % C:/Program Files/MATLAB/R2010b/help/techdoc: cd ../.. % Use a relative path to change the current folder from % C:/Program Files/MATLAB/R2010b/help/techdoc back to % C:/Program Files/MATLAB/R2010b/help/techdoc/matlab_env/examples: cd matlab_env/examples % Change the current folder from its current location to a new % location,but save its previous location. Later, change the % current folder to the previous location. % This returns % C:/Program Files/MATLAB/R2010b/help/techdoc/matlab_env/examples % to oldFolder, and then changes the current folder to % C:/Program Files: oldFolder = cd('C:/Program Files') % Display current folder: pwd % Change the current folder to the previous location: cd(oldFolder) pwd
在Unix上®平台,将当前文件夹更改为当前正在运行的MATLAB的示例目录,假设它安装在您的家庭位置:
CD('〜/help/techdoc/matlab_env/示例')