# Installing Octave on Ubuntu 14.04

I’m taking Andrew Ng’s machine learning class at coursera that started June 17, 2014. In the Silicon Valley tech world, this seems to be the online course that many people recommend for machine learning. The course is taught using Octave or Matlab. I’ll use Octave because I’m on Ubuntu and Octave is a gnu project.

I will also blog about the topics covered using Python because this is my language of choice. However, I will not poster answers to exercises. Instead I will discuss the method and how to implement, or use existing tools, in Python.

First, let’s install Octave and gnuplot:

$sudo apt-get install octave gnuplot  Accept all the suggestions (there are many) and let the installation complete. Starting Octave from the terminal should look something like this (I try out the first part of the Octave simple examples before exiting): $ octave
GNU Octave, version 3.8.1
Copyright (C) 2014 John W. Eaton and others.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  For details, type 'warranty'.

Octave was configured for "x86_64-pc-linux-gnu".

Please contribute if you find this software useful.

Read http://www.octave.org/bugs.html to learn how to submit bug reports.
For information about changes from previous versions, type 'news'.

octave:1> A = [ 1, 1, 2; 3, 5, 8; 13, 21, 34 ]
A =

1    1    2
3    5    8
13   21   34

octave:2> B = rand (3, 2);
octave:3> B
B =

0.225359   0.115306
0.548261   0.295556
0.166765   0.073095

octave:4> A * B
ans =

1.10715    0.55705
4.75150    2.40846
20.11315   10.19090

octave:5> exit


That’s it, Octave (version 3.8.1) is ready to go. The class website has some Octave tutorials. I also found the wikibooks Octave tutorial, which seems to cover many of the basics in a concise way.