【发布时间】:2017-11-13 19:01:19
【问题描述】:
我正在使用 Octave io 包,但在我运行脚本之前它会一直自行卸载。我正在使用io 提供的xlsread 函数,但我不断收到以下错误:
warning: Functions for spreadsheet style I/O (.xls .xlsx .sxc .ods .dbf .wk1 etc.) are
provided in the io package. See <http://octave.sf.net/io/>.
Please read <http://www.octave.org/missing.html> to learn how you can contribute missing
functionality.
error: 'xlsread' undefined near line 25 column 23
当我输入pkg list 时会显示该包,当我输入pkg load io 时它旁边有一个星号。我什至编辑了octaverc 以在启动时加载io。但是当我运行我的脚本以及在我的脚本失败后检查pkg list 时,我得到了那个错误,包被卸载了。
【问题讨论】:
-
您的脚本开头是否有类似
clear all的内容?假设脚本中的某个命令清除了加载的包,您应该尝试以下操作:在脚本中,在调用使用它的函数之前导入包 - 看看它是否有帮助。 -
是的,就是这样。谢谢!
-
不客气!我发布了上述解决方案作为答案。
标签: import package octave undefined-function