Install Octave packages on ubuntu 16

你离开我真会死。 提交于 2019-12-12 03:43:13

问题


I tried several commands to install the package optim into my Octave in Ubuntu 16.10 to use the function xcorr, but I miserably failed.

Some of these commands were:

- sudo apt-get install octave-optim
- sudo apt-get install liboctave-dev
- sudo apt-get install octave-signal
- sudo apt-get install octave-pkg-dev

Can somebody explain me or does somebody know how to install the packages in Ubuntu 16? After running the above-mentioned commands, I restarted Octave but the command xcorr() was still returning the error:

warning: the 'xcorr' function belongs to the signal package from Octave Forge which you have installed but not loaded. To load the package, run 'pkg load signal' from the Octave prompt.

Unfortunately, 'pkg' returns:

No command 'pkg' found, did you mean: Command 'pig' from package 'bsdgames' (universe) Command 'peg' from package 'peg' (universe) Command 'pki' from package 'pki-tools' (universe) Command 'pki' from package 'strongswan-starter' (main) Command 'dpkg' from package 'dpkg' (main) Command 'pg' from package 'util-linux' (main) Command 'ekg' from package 'ekg' (universe) Command 'ekg' from package 'ekg-gtk' (universe) pkg: command not found


回答1:


Please type pkg load signal in the Octave command prompt, as you have already have it installed. To auto-load it everytime you start Octave, create ~/.octaverc file and add the line pkg load signal inside the file.

If in future, the pkg that you need is not currently installed, you will need to install it with pkg install -forge <pkgname> e.g. pkg install -forge io. Similarly, you will need to load it as described earlier.

Hope it helps.



来源:https://stackoverflow.com/questions/40490798/install-octave-packages-on-ubuntu-16

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!