我有以下声明来设置日记和日记文件:
fnDiary = [ mfilename '.out.txt' ]
system(['rm -f ' fnDiary])
diary off; diary fnDiary这是行不通的,因为Octave认为我希望日记文件名为"fnDiary“。是否有使用字符串变量指定日记文件的方法?
发布于 2016-11-22 10:31:52
这是一个常见的错误。Octave (和Matlab)将函数的参数作为字符串处理。用这个:
fnDiary = [ mfilename '.out.txt' ]
unlink (fnDiary)
diary off;
diary (fnDiary)https://stackoverflow.com/questions/40736389
复制相似问题