Octave提交作业第一次遇到了问题
主要就是找不到ex1文件夹里面的子文件夹lib里面的文件
经过分析,应该是由于ex1加入路径以后并没有把子文件也加入路径,才导致提示一些文件不存在。把lib文件夹加入以后就可以顺利提交了
在这个过程中用到了几个命令
>> pwd
ans = E:\mooc\my-learning\machine-learning-ex2\ex2
pwd是用来打印当前路径的
>> addpath(pwd)
然后添加路径用addpath语句,最后如果需要保存路径呢?
>> help savepath
'savepath' is a function from the file C:\Octave\OCTAVE~1.2\share\octave\4.2.2\m\path\savepath.m
-- savepath ()
-- savepath (FILE)
-- STATUS = savepath (...)
Save the unique portion of the current function search path that is
not set during Octave's initialization process to FILE.
If FILE is omitted, Octave looks in the current directory for a
project-specific '.octaverc' file in which to save the path
information. If no such file is present then the user's
configuration file '~/.octaverc' is used.
If successful, 'savepath' returns 0.
The 'savepath' function makes it simple to customize a user's
configuration file to restore the working paths necessary for a
particular instance of Octave. Assuming no filename is specified,
Octave will automatically restore the saved directory paths from
the appropriate '.octaverc' file when starting up. If a filename
has been specified then the paths may be restored manually by
calling 'source FILE'.
See also: path, addpath, rmpath, genpath, pathdef.
这是对savepath的命令帮助,注意里面写的,如果没有路径,会存到octaverc
>> savepath
warning: savepath: current path saved to ~\.octaverc
执行命令后发现确实存储了,但是这个文件在哪里还没找到 待续