Editing FAQ

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 285: Line 285:
==How do I install or load all Octave Forge packages?==
==How do I install or load all Octave Forge packages?==


Do not do it!  Really, there is no reason to do this.  Octave has many packages for different needs and is unlikely that you need all of them.  You either have a small set of required packages, in which case
Do not do it!  Really, there is no reason to do this.  Octave has many
you know them by name; or you want them all "just because", in which case you don't really need them.
packages for different needs and is unlikely that you need all of
them.  You either have a small set of required packages, in which case
you know them by name; or you want them all "just because", in which case
you don't really need them.


The common misconception is that the more packages one has installed and loaded, the more complete and powerful its Octave installation will be. However, in the same way one would never install all perl modules, ruby gems, python packages, and C++ libraries (because it simply makes no sense), one should not install all Octave packages.
The common misconception is that the more packages one has installed
and loaded, the more complete and powerful its Octave installation will be.
However, in the same way one would never install all perl modules,
ruby gems, python packages, and C++ libraries (because it simply makes
no sense), one should not install all Octave packages.


Packages should be installed and loaded selectively.  Note that some packages are meant to shadow core functions changing the way Octave works, and that different packages can have different functions with the same name leading to unpredictable results.
Packages should be installed and loaded selectively.  Note that some
packages are meant to shadow core functions changing the way Octave works,
and that different packages can have different functions with the same name
leading to unpredictable results.
 
If you really really really want to do load all packages, you can with
the following:
 
## WARNING: loading all packages is probably not the solution you are looking for.
cellfun (@(x) pkg ("load", x.name), pkg ("list"));


If you really really really want to do load all packages, you can with the following:
<syntaxhighlight lang="octave">
## WARNING: loading all packages is probably not the solution you are looking for.
cellfun (@(x) pkg ("load", x.name), pkg ("list"));
</syntaxhighlight>


==I have installed a package but still get a "foo undefined" error?==
==I have installed a package but still get a "foo undefined" error?==
Line 314: Line 325:
==How do I automatically load a package at Octave startup?==
==How do I automatically load a package at Octave startup?==


When Octave starts, it runs the file {{Path|~/.octaverc}} (in your user's home directory).  If you want Octave to automatically load a package, simply add a <code>pkg load pkg-name</code> command to it.  If the files does not exist, create it.
When Octave starts, it runs {{Path|~/.octaverc}}.  If you want Octave to
automatically load a package, simply add a {{codeline|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.
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.


=Octave usage=
=Octave usage=
Please note that all contributions to Octave may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Octave:Copyrights for details). Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)