Installing Octave

Octave is a powerful, free program that can numerically solve and graph solutions to ordinary differential equations. It can also solve linear algebra problems, etc. It is similar to the widely used commercial package MATLAB.

If you are in the Welch Hall computer labs you dont need octave, use MATLAB instead.

You can download octave or read about it at the octave website http://www.octave.org . If you use Linux then you probably don't need to download it from the website because it is probably part of your Linux distribution. If you use a Mac then please follow the links on the Octave website.

Instructions for installing Octave on Windows

The following instructions worked on my Windows XP system. It assumes that you do NOT have a program called "cygwin" installed on your Windows system. (Cygwin is a program that makes it possible for Windows to run Linux applications. You'll know if you have it.) If you have cygwin then follow the above link instead of the one on the next line.

  1. Assuming you don't have cygwin, follow this link to download the installer, "Octave-2.9.13-setup.exe". It's a big file (about 40Mb) so be patient while it loads. When the installer has finished loading it will put an "Octave setup" icon on your desktop. Click on the icon and follow the instructions.
  2. When the installer is finished it will put an icon (a "shortcut") on your desktop that you can use to start octave. There is also a manual, an editor, and some other things. To find them, click START >> All Programs >> Gnu Octave.
  3. Start Octave by clicking the Octave shortcut. It takes a little while to load but after a few seconds you'll get a command prompt.
  4. Type

    edit

    at the command prompt. If the SciTE editor starts up that's great. But it probably won't; you'll get a bunch of error messages instead because there's an error in one of the startup files that comes with the installation. If this happens click Start >> My Computer then navigate to this file:

    C:\Program Files\Octave\share\octave\2.9.13\m\startup\octaverc

    This is the systemwide startup script ("rc" stants for "run command"). Make a copy of this file with a new name octaverc.original so you don't lose it, then replace it with the corrected octaverc file that you may download here. (Delete the ".txt" at the end of the file name when you download it).

    Kill octave, restart it, then type edit at the prompt. The SciTE editor should now start.

  5. When Octave starts up it looks in your home directory for a personal .octaverc file (the leading dot is required on your personal file). Any commands you put in your .octaverc file will be run once when octave starts up. On Windows your home directory should be something like this

    C:\Documents and Settings\Your Name

    where "Your Name" is your name of course. If you're not sure what your home directory is called, find it using "My Computer" or execute the command

    echo %USERPROFILE%

    at the DOS prompt.

    Create a .octaverc file with a text editor like SciTE and put it in your home directory. Here is an example you might want to follow


    ## Example .octaverc file
    ## Tell octave to look for mfiles in the default directory
    ## C:\Documents and Settings\Your Name\Octave

    addpath(home_path);

    ## End of example


    mfiles are programs that you or others have written. There is only one command in this file; all lines that begin with "#" are comments.