Install Octave on Mac OS X 10.9

Recently I am working on Stanford Machine Learning Course By Andrew NG on Coursera, Andrew recommended Octave to build prototype quickly. It’s been tricky to install octave on Mac, so I shared my process of intalling it.

1.Install XQuartz

2.Install Xcode and Command Line Tools3

3.Install homebrew

It’s important to solve all the warning in homebrew, so it can work smoothly when installing octave.

4.Import the scientific computing packages

5.Install Octave

6.Install gnuplot

(Update: As phseven pointed out, gnuplot will be automatically installed with octave, but in some cases it won’t support X11.) For such cases, do the following:

If you plot something in Octave, and it occures problems like this:

Just run:

befor you plot anything, e.g.,

It will be convenient if you setup Octave startup file: vim ~/.octaverc and add the line setenv GNUTERM x11.

7.Open Octave just run octave, if you want to change the look of your Octave, just input PS1('>> ')

Reference: http://jatinganhotra.com/blog/2014/01/21/installing-octave-on-os-x-10-dot-9-mavericks/