MATLAB修改启动有几种方法,其中包括临时的方法和永久性的方法,在这里简要介绍。
cd(change directory)
使用 cd命令,cd是dos系统下的改变路径的命令,全称是 change directory,使用cd命令可以直接的改变当前的工作路径,MATLAB的官方帮助文档说明如下:
cd
Change current foldercollapse all in page
Syntax
cd(newFolder)
oldFolder = cd(newFolder)
cd
Description
cd(newFolder) changes the current folder to newFolder.
oldFolder = cd(newFolder) returns the existing current folder as a string to oldFolder, and then changes the current folder to newFolder.
cd displays the current folder.
Input Arguments
newFolder
A string specifying the folder to which you want to change the current folder. Valid values can be any one of the following:
A full or relative path.
../, which indicates one level up from the current folder.
Multiple strings of ../, which indicates multiple levels up from the current folder.
./, which indicates a path relative to the current folder, although without the ./, cd assumes that the path is relative to the current folder.
Output Arguments
oldFolder
A string specifying the current folder that was in place when you issued the cd command.
Definitions
The current folder is a reference location that MATLAB® uses to find files. This folder is sometimes referred to as the current directory, current working folder, or present working directory.
Examples
Use cd with the matlabroot function to change the current folder to the examples directory for the currently running version of MATLAB:
cd(fullfile(matlabroot, ‘/help/techdoc/matlab_env/examples’))
On a Microsoft® Windows® platform, specify the full path to change the current folder from any location to the examples directory for MATLAB Version 7.11 (R2010b), assuming that version is installed on your C: drive:
cd('C:/Program Files/MATLAB/R2010b/