In the last few months I’ve decided to break off a ~15 year relationship with Matlab. We’ve been through many important times together and it’s not been an easy decision to make, but I think this is the best for both of us.

Matlab saw me through my DPhil, helping me code up neural network simulations of  retinal receptive fields. Matlab was also there during my postdoc, helping me to communicate with robotic eyes made of webcams and servo-motors. Matlab also helped me learn a wide range of skills in machine learning, Bayesian inference, cognitive modelling, and conducting a few visual psychophysics experiments. Matlab was even there when I needed to compute a solution the constrained optimisation problem of allocating students to elective modules.

But, despite the good times, cracks in our relationship started to appear a little while ago. Initially I found myself getting a little bored or even annoyed. And then there were passing encounters with other languages which attracted my attention and made me realise that the sea is full of many fish. It got to the point where I made a list of grievances. It was then that I realised it was going to end.

  • Annoying licensing issues. So when I’m using Matlab off-campus, I have to log into my university network by VPN. So how am I supposed to do that when I’m off-grid?
  • Matlabs’ origins are as a matrix algebra language (see this 8m video of the origins of Matlab) as opposed to a ‘proper’ general purpose language. Yes Matlab is very flexible, but there are other options out there which have features I was not even aware of.
  • Annoying code editor. Perhaps I have high standards here, but if I spend a lot of time creating, editing, and debugging code, then I maybe want to do that in a really nice looking environment. I want different font and colour themes. I want the option for automatic word-wrap. I want to be able to run selected code with a sensible key combination (not shift-F7, which doesn’t even work on my Mac). And I know I can run all the code in a cell, but I want more control than that. Why can’t I have cmd-Enter, like in R Studio? I also want as much screen real estate as possible to focus on my code. The editor has a ridiculously big toolbar, and other smaller wastes of time around the edges of the code windows that become a concern when working on a laptop.
  • Annoying separate toolboxes. Why do I have to pay money for the Parallel Computing Toolbox just so I can utilise all cores of my CPU? Things like this should be part of the core Matlab package.
  • Annoying graphics. It is very possible to create excellent publication quality graphics with Matlab, but it takes so much work! The default plot styles are just terrible.
  • Annoying Java-related crashes. yes, I could probably figure this out and fix it, but can I be bothered?
  • I am certainly not one of those hippies who believes that everything that moves should be open source. I want stuff to work. If it doesn’t, then I’m not going to look at it. But the amorphously-defined Open Science (or Science 2.0) movement seems to be stumbling foreword at an increasing pace, and while it could just be the influence of my particular set of young and dynamic peers, I find the logic rather appealing. But that’s for another discussion. But for the highest number of people to be able to examine and use your experiment or analysis code, then you want:
    1. The software to be free or very cheap such that many other people can use it.  I realise as a commercial product, nothing can be done about this, but that doesn’t make it irrelevant when considering what language to use.
    2. If computationally-heavy science is going to be open and reproducible, then you need decent ways of exposing and documenting that. In terms of Matlab has it’s ‘publish‘ function to generate readable, commented version of your code, and I am using this feature in an upcoming paper. But, as I may well write about in the future, there are tools out there which show more promise, power, and flexibility. It also uses it’s own mark-up style, and I really don’t want to have to learn yet another syntax. Why can’t we just use MarkDown, or MultiMarkDown, which seems to be the way how things are going?

Of course I will continue to use Matlab from time to time. There will be code I will need in the future and it would be counter-productive to convert all of that just for the sake of it. The level of familiarity and expertise I’ve gained over ~15 years will not be superseded overnight, so perhaps there will be some quick projects that I’ll just do in Matlab. But 2014 marks the start of my transition away from Matlab into a new land.

I may map out my journey as and when I feel the need to procrastinate. Next post will cover the advantages of my new language of choice, Python.