关于这个主题的Octave文档既令人生畏又稀疏.
我不知道在哪里记录我找到的解决方案,所以我在这里发帖.如果这不合适我道歉,但我想帮助下一个人.
以下解决方案适用于可分发的简单窗口.
使用案例:
在Octave 3.2.4中开发了一个解决方案,需要以很少的计算机技能分发给最终用户.安装和解释Octave是不可能的,解决方案必须是"一键式"或"脑死亡 - 简单".
已知问题:
imread在3.2.4中失败,因为file_in_path.m是错误的.您需要将文件file_in_path.m更新为以下内容(只需替换它):
function name=file_in_path(p,file)
idx=[1 findstr(p,pathsep) length(p)+1];
for i=1:length(idx)-1
if idx(i+1)-idx(i)<=1
dir=strcat(pwd,"/");
else
dir=p(idx(i)+1:idx(i+1)-1);
end
name = fullfile(dir, file);
fid = fopen(name,"r");
if fid >= 0
fclose(fid);
return
end
end
fid = fopen(file,"r");
if fid >= 0,
fclose(fid);
name=file;
return
end
name=[];
Run Code Online (Sandbox Code Playgroud) octave ×1