0

I'm using the Octave io package but it keeps unloading itself before I run the script. I'm using the xlsread function provided by io but I keep getting the following error:

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

The package shows up when I type pkg list and there is an asterisk next to it when I type pkg load io. I even edited the octaverc to load io on startup. But I get that error when I run my script and when I check pkg list after my script fails the package is unloaded.

Dev-iL
  • 23,742
  • 7
  • 57
  • 99
ktal
  • 263
  • 1
  • 3
  • 4
  • Do you have something like `clear all` at the beginning of your script? Assuming a certain command in your scripts clears the loaded packages, here's what you should try: in your script, import the package right before calling the function that uses it - and see if it helps. – Dev-iL Nov 13 '17 at 19:02
  • Yeah that was it. Thanks! – ktal Nov 13 '17 at 20:06
  • You're welcome! I posted the above solution as an answer. – Dev-iL Nov 13 '17 at 21:59

1 Answers1

0

Make sure you don't invoke clear all (or similar commands) somewhere in your script, as this might also remove loaded libraries from memory.

Dev-iL
  • 23,742
  • 7
  • 57
  • 99