Matlab Excitement

A new project is in my sights! Not to say that the video project is no longer interesting, but it requires many long hours of rendering. When you look at a little encoding progress bar that boasts 28 hours left for a three pass VBR encode, you can’t do much except wait.

The new project is to help Madalene with some data from her lab. She uses Matlab to do many of her calculations, and Matlab has its own little scripting language for automating procedures and creating more complex algorithms. She has a huge number of data files, each one containing data that needs to be fed into Matlab via a little program someone wrote in its scripting language. Unfortunately, the file outputs Lotus 1-2-3 documents, that are not formatted for easy manipulation. Madalene has to manually input data for over 200 files, and then open up each of the 200-odd Lotus 1-2-3 documents in Excel, copy and paste out the values she needs, and then do her calculations. Any time anyone says to me that they have to hand process 200 files, one thing comes to my mind. PERL!

Perl, as a programming language, is great for processing text files, and gathering up data. It is right up there among the most useful programming languages ever, in terms of day to day usefulness. It really lends itself to little ‘glue’ programs, things that don’t do much besides connect two things that don’t normally connect well. In this case, I have decided to aid Madalene, as well as improve my knowledge of Perl (which is woefully inadequate) by writing a script to go through these hundreds of files, grab the values necessary, feed them to Matlab, gather the output, and produce a single, well formatted Excel document. Not a difficult task for Perl, but it is still of a magnitude that I’ve never attempted before. Assuming all goes well, I’ll come out of it with a better understanding of Perl and Matlab, and the satisfaction of being able to show a bunch of stuffy researchers who The Man is by automating part of their process. Just kidding, they aren’t stuffy researchers, but if I pull this off, I’ll still get to be The Man, for a day or so at least.

4 Responses to “Matlab Excitement”

  1. on 06 Mar 2003 at 4:58 pm Dad

    Good luck with this project. It sounds like you will be up some late nights, just like researchers! Sometimes when projects like this get presented to me, I immediately think: BEER! But then that’s not a programming language. Bummer…

  2. on 06 Mar 2003 at 5:50 pm sam

    It reminds me of that simpsons where homer is working from home after gaining 300 pounds, and he’s on the computer, and he figures out that he can just hit ‘y’ instead of typing out ‘yes’ and he says, “Whew, all this computer hacking is making me thirsty!” Thats how I feel sometimes.

  3. on 06 Mar 2003 at 9:12 pm Andrew

    Can’t say I know much about Matlab, but I do know that Mathematica has an add-on that allows it’s scripting language to talk directly with Excel about the data in Excel files. I can’t help but think that there’s got to be something similar for Matlab.

  4. on 06 Mar 2003 at 9:19 pm sam

    You are exactly right, Andrew, unfortunately, the version of matlab we are working with is an older version her lab has, which sadly does not support the feature of writing directly to excel files. Also, even if it did, some perl hacking would be necessary to get the data out of the Lotus 1-2-3 or Comma Seperated Value files that it creates, and put them into one place, something the Matlab scripting language isn’t well equipped to do.. I wish we were using the newer version though, that would make life a bit easier.

Feed on comments to this Post

Leave a Reply