Wednesday, 25 January 2012

Working with octave

As I'm about to enter a development project (dealing with modeling of wireless communications networks), I'm looking for a suitable set of languages and tools.

For years I've been using Matlab. However, being on my own (I've quit and set up my own startup at wilabs.com), I look for reliable but inexpensive solutions. Unfortunately Matlab is not one of them.

Clearly, a straight forward alternative seems to be Octave (www.octave.org). Here are some discoveries I've made.

  1. Octave looks Matlab alike
  2. It is not 100% compatibilie, so don't be irritated if some of your old code does not work out of the box
  3. Octave lacs full featured IDE;
    There are supposed to be alternatives, but unfortunately they don't offer level of support one gets in Matlab IDE. Well, life is not perfect! Here are some I looked at:
    1. QtOctave
      Looked quite fine, but somehow debugging was not working correctly. At least for me. Although the product seemed to be quite advanced, the development has stopped :/ (well, there might be followers to pick it up)
    2. GUIOctave
      Looks fancy. I even switched to Win7 for a moment to check it out. Fresh installation (as of 26-01-2012) did not work with fresh Octave :( I did not feel like spending more time (my target OS environment is still GNU/Linux) and gave up.
    3. XOctave
      Have not tried it yet. Will do so. From the pictures it looks like debugging works (this would be surprise!)
    4. Emacs
      After a couple of hours looking for a solution I ended up with emacs (http://www.gnu.org/software/octave/doc/interpreter/Emacs-Octave-Support.html#Emacs-Octave-Support) - good stuff never dies! ;)
      Today I am setting up the stuff and getting to the old style development environment of emacs - I'm not (yet) complaining, although the learning curve seems quite steep already

My general experience: I very much admire all the efforts of all the people being involved in open source tools, including Octave and tools around. The achievement  is great, though, perhaps the weakest side of Octave is that it does not come with a reliable IDE which one can just launch and start Octave code development. Although I don't consider myself as computer illiterate, I had a hard time trying execute my old Matlab code, for which debugging with editing, etc. is obviously a must. My point is that probably many people (like me) would conisder Octave as very valuable alternative to matlab, but probably few have skills and persistence to try to live with one of the above.

But hey, I'm not giving up just yet :)
The idea is to try to tweak Emacs to do all good stuff it is able to, including debugging. Below I'm sharing my discoveries:

Useful emacs stuff, which I find convenient while working with Octave
  • line highlighting (to better see where you are): M-x hl-line
  • line numbering: M-x linum-mode 
  • as it turned out there are Octave/Matlab Emacs modes available
    • Octave-mod
      Comes with Emacs (included), but to my view lacks debugging capability (well there is some, I admit)
    • Matlab-mod
      Seems to have much more functionality. Though, it can suffer from Octave-Matlab incompatibility issues. The mode is meant to use GUD for debugging, which seems as very structured and elegant solution.


    No comments:

    Post a Comment