Doing Battle with Matlab

By Nick

My desktop on Thursday

The past few weeks of my life have been spent in near constant battle with the forces of evil, aka Matlab. Matlab is a “numerical computing environment”, a 4th generation computer programming language, which means that it is focused on specific tasks, with much of the complex building blocks already pre-programmed and packaged. And this is normally the point at which I get bored, go and do something else, and end up using Microsoft excel for my data analysis. It is the easy way out.

But why should I take the easy way out, life as a graduate student was never meant to be easy, and if I make the effort now, early in my career, I will be rewarded in the future. So here I am, stuck at my desk, frequently having shouting matches with my computer, wondering why I bothered starting down this difficult road in the first place.

The end goal seems like a distant land of milk and honey, where my data magically organises itself, correlations frolic in the lush grass, graphs flutter from flower to flower, and papers pretty much write themselves. You see, the end results of Matlab are compelling. Its easier to organise data, to find correlations, to make graphs, to perform statistical tests, to produce figures.

However, to get to this land, one must walk a horrible path, a journey of pain and frustration, trying to understand and learn how to do these things. Once they’ve been done once, they become easy to repeat. But doing any programming for the first time is a tortuous process. Pretty much all of the time IT SIMPLY DOES NOT WORK! Most of the time for no good reason. I get frustrated, I shout at my computer, I storm out of the room in a huff. I think its lucky I have an understanding officemate who sympathises with my frustrations and celebrates my minor successes.

I suppose that the geophysicists are probably laughing at me right now, with their computer wizardry, they probably consider something as derived as Matlab as rather simple. And I guess we can’t all be programming geniuses. But here’s the rub of the green: no matter how much I disliked my undergraduate maths courses. No matter how frustrating I find getting the computer to do a simple task like drawing a single line. Competent data analysis is an essential tool for today’s Earth Scientist and, like it or not, Matlab will make me a better scientist . Its going to be tough, very tough. But I’m ready.

All I need now is a montage.

2 Responses to Doing Battle with Matlab

  1. At least it isn’t as bad as ArcGIS. *shutter*

  2. The attraction of a ‘high level language’ like Matlab is you can get a lot of work done in a few lines of code. The ‘trick’ about programming is that the writing of the code is not where all the real effort needs to be focused. A methodological approach to design and testing are essential parts to any successful programming project. [I need to tell myself this on a regular basis when I find myself diving in without enough forethought]

    I can share an anecdote that may or may not be useful. My son had hacked quite a bit of code (PHP/Drupal – but that is not the point) together to get his website together. It worked, but it was not extensible nor was it easily ammended with newer versions of PHP or Drupal). I pointed him at the following online lecture series and the light went on. He put together a tight extensible Drupal module from scratch that was able to be easily modified when he upgraded to a new Drupal version.

    http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-00-introduction-to-computer-science-and-programming-fall-2008/video-lectures/lecture-1/

    Since then, programming for him has been more hit than miss and he only needed to ask me foundational stuff like floating point arithmetic (incl rounding/truncation) and number theory(mod/div), etc.

    HTH

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s