- relative path names
- the '.' notation refers to the current directory.
what is the difference between pwd and cd ?
81 ビュー (過去 30 日間)
回答 (1 件)
Stephen23 2016 年 3 月 21 日
編集済み: Stephen23 2016 年 3 月 21 日
Actually pwd just calls cd internally, so there is no real difference.
However I would suggest using pwd: Changing directories is a very slow way to write code (it is much faster to pass relative/absolute paths to any functions that access files of any kind), so using pwd has the advantage that it stylistically make it clear "this does NOT change the directory, we just need the path...".
In other words, using pwd encourages better programming habits.
Some faster alternatives to cd / pwd:
More useful info here: http://www.mathworks.com/help/matlab/matlab_env/specify-file-names.html