Reader small image

You're reading from  GNU Octave Beginner's Guide

Product typeBook
Published inJun 2011
Reading LevelBeginner
PublisherPackt
ISBN-139781849513326
Edition1st Edition
Languages
Right arrow
Author (1)
Jesper Schmidt Hansen
Jesper Schmidt Hansen
author image
Jesper Schmidt Hansen

Jesper Schmidt Hansen holds a Ph.D. in soft-material science and is currently doing research in the field of nanofluidics and dynamics at Roskilde University, Denmark. He has been using GNU Octave on a daily basis for many years, both as a student and later as a researcher. The applications have varied from solving partial and ordinary differential equations, simple data plotting, and data generation for other applications, to dynamical system investigations and advanced data analysis.
Read more about Jesper Schmidt Hansen

Right arrow

Time for action - creating an Octave home directory under Windows


Let us assume that the Octave home directory is going to be C:\Documents and Settings\GNU Octave\. We can actually create this directory directly from Octave; so let us go ahead.

  1. 1. Start Octave and give it the following commands:

octave:1> cd C:
octave:2> cd "Documents and Settings"
octave:3> mkdir "GNU Octave"
ans = 1
  1. 2. The response ans = 1 after the last command means that the directory was successfully created. If Octave returns a zero value, then some error occurred, and Octave will also print an error message. Instead of creating the directory through Octave, you can use, for example, Windows Explorer.

  2. 3. We still need to tell the interpreter that this is now the Octave home directory. Let us do this from Octave as well:

octave:4> edit
  1. 4. You should now see an editor popping up. The default editor under Windows is Notepad++. Open the file c:\octave-home\share\octave\site\m\startup\octaverc, where octave-home is the path where Octave was installed, for example, Octave\3.2.4_gcc-4.4.0. Add the following lines at the end of the file.

    setenv('HOME', 'C:\Document and Settings\GNU Octave\');
    cd ~/
    
  2. Be sure that no typos sneaked in!

  3. 5. Save the file, exit the editor, and restart Octave. That is it.

Note

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

What just happened?

The first three Octave commands should be clear: we changed the directory to C:\Documents and Settings\ and created the directory GNU Octave. After this, we opened the global configuration file and added two commands. The next time Octave starts it will then execute these commands. The first instructed the interpreter to set the home directory to C:\Document and Settings\GNU Octave\, and the second made it enter that directory.

Creating your first .octaverc file

Having created the Octave home directory under Windows, we can customize Octave under GNU/Linux and Windows the same way.

Previous PageNext Page
You have been reading a chapter from
GNU Octave Beginner's Guide
Published in: Jun 2011Publisher: PacktISBN-13: 9781849513326
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Jesper Schmidt Hansen

Jesper Schmidt Hansen holds a Ph.D. in soft-material science and is currently doing research in the field of nanofluidics and dynamics at Roskilde University, Denmark. He has been using GNU Octave on a daily basis for many years, both as a student and later as a researcher. The applications have varied from solving partial and ordinary differential equations, simple data plotting, and data generation for other applications, to dynamical system investigations and advanced data analysis.
Read more about Jesper Schmidt Hansen