I am using Octave on Window vista. I am using 4 package in my code. But every time I restart octave, I have to load manually from command line, 'pkg load ...' Is there a way to load them permanently so that whenever Octave is started it finds them in its path.
To install a package from the Octave Forge, at the Octave prompt type pkg install -forge package_name . This requires an internet connection. If you use a very old Octave version (< 3.4. 0), you'll have to download the package file manually, and use pkg install package_file_name.
Community packages are coordinated between each other and with Octave regarding compatibility, naming of functions, and location of individual functions or groups of functions. See also: external packages, unmaintained packages.
When Octave starts, it runs ~/.octaverc
. If you want Octave to automatically load a package, simply add a pkg load pkg-name
command to it. If the files does not exist, create it.
If you do this, remember that other people may not have Octave configured to load packages at startup. Therefore, if you write code for others, remember that your programs still need to load the packages they require.
Do not use pkg install -auto ...
or pkg rebuild -auto ..
because that will stop working on the next Octave release.
I got the answer. It can be set at the time of package installation. install with following command pkg install -auto [package name] It will be load every time octave is started.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With