Matlab


Just an update on the Matlab situation. I recently did renew my maintenance fees, but dropped support for the optimization, mapping, and GARCH toolboxes as I never used this. The only thing I ever used the mapping toolbox for was calcultating distances, and that got busted at some point. The free m_map software is a far superior toolbox, and did I mention it was free?

Part of the decision was that all of the analysis for the last chapter of my dissertation was done in R. Some data mining was done with Python, oceanographic transects/profiles in Ocean Data View and maps in GMT, but all analysis was done in R. This was a revelation to me, mostly due to the change in not having to write an m-script full of loops. I know that some of this is due to my bad habits in Matlab (not using the vector operations and writing loops instead) but there are so many convenience functions in R that just do what I want, and I think that this reflects a change to a more statistically demanding anaylsis style that Matlab really just isn’t built for.

This isn’t to say that one is better than the other, but with the cost and difficulty in getting Matlab up and running on new machines, R is definitely more than a viable option, and a joy to work with.

Advertisements

At this point just a small update to say that since the activation fiasco, I have not used Matlab at all. Everything that I have done for the last four presentations has been done with R and Python, and I am both the happier and wiser for it.

I have been playing with JMP a bit, but honestly, it’s a bit too “high level” and while it’s neat for data exploration, it really made me nuts that two weeks after I got a license, they were *offering* me a special deal on the impending upgrade. Nothing like dropping a bundle on instantly outdated software. Way to go guys.

So for me, it’s been a pleasure to use R, Python (with iPython of course), and ferret on my Mac Pro. If I ever take a break from playing on the computer I’ll post up what I installed on the new Mac in terms of scientific software.

OK, so I spent a bit of time yesterday thinking about some alternatives to Matlab versus the time/money balance of learning a completely new system. Today’s adventure activating Matlab 2008a has me definitely leaning in the “alternative” direction.

A little background on Matlab 2008a and the activation model. With 2008a Matlab has moved to an activation model, where you have to basically register your computer with The Math Works. With an individual license there are two choices you have: lock the license to a computer, or lock it to an individual. As I use Matlab at home, at work, and on my laptop I chose to lock it to myself.

Now Matlab 2008a came out in February 2008, and I’m just trying to install it now, which is all based on my fear of activation, since usually I am eager to download and install the latest version. So I bit the bullet yesterday and installed the OSX (laptop) and linux versions. Usually I get a nice CD package with installations for all platforms but that must have ended as well.

So this morning I figured that I would give installation a go. Usually a 5-10 minute affair, I spent 90+ minutes on this, and it still doesn’t work on the linux box. Basically what would happen is that I would go through the automated steps (generate the file key, license file, download and give info where needed, rinse, repeat) and watch Matlab completely have a hissy fit that either my username didn’t match, or my host ID didn’t match or that I didn’t have the desk pointed northeast (well, not that last one). I did my civic duty and dug around the troubleshooting site, where I found exactly three entries for activation problems. This must mean that I am completely unlucky to both have a problem and to have a non-standard problem that could not be fixed with answers #1-3.

At any rate, time is money right? So I figured I would give tech support a call. I got through on the second try, and actually go a human who was surprisingly helpful. The main problem on both machines was that the host ID generated was from the MAC address of the active internet connection, which is not what the license manager wants to see. So the laptop fix was an easy one after all, just use the MAC address of the primary connection, which was the wired connection (I was using the wireless at the time). In hindsight, yeah, that makes sense, but there’s still too much voodoo involved for me.

The linux box was worse, where I do not have eth0 enabled since I have problems with it, and I use eth1 instead. So while to the operating system there is only eth1 (as far as I understand) the license file wants to communicate with eth0, which of course doesn’t exist in the software space (now I may be way off on this, but this is what I could come up with for now). So my options are to either rename eth1 to eth0, or activate eth0. Well guess what, at this point I’m inclined to just not run Matlab 2008a since I don’t really feel like risking the possibility of borking my internet connection just to get the latest version of Matlab running. So remind me again why I am paying those maintenance fees? Maybe I’m no activation super genius, but should it really be this difficult to get software that you’ve paid good money for to run? Sure, there’s still an open thread with tech support but how much more time do I want to spend on this today? Well that’s easy, none.

Now I may feel differently in a bit and try again. Or I may just drink more coffee and start installing Sage or Enthought and see how that goes. Or maybe I’ll just try to get some work done.

Technorati Tags:
, , ,

I’ve been a Matlab user for 15 years, and over that time period I’ve of course become fairly dependent on it to get things done quickly. The downside? It’s expensive. It’s a pretty penny to buy the base package, toolboxes are extra, and there are recurrent “maintenance” costs each year to get upgrades.

Sure, that’s standard practice, but each year I have to stand up and justify to my boss why we need to pay these costs for our multiple Matlab users in our shop (a multi-user concurrent license is out of the question, don’t even ask). So what’s a user to do?

For years we’ve just bit the bullet and paid the fee, but with options such as R and Numpy/SciPy out there it may be time to loosen the chain a bit. Or maybe not.

A couple of possible alternatives to Matlab and their respective pros and cons:

R

R is a really nice statistical environment which has pretty much become the industry standard, replacing the very expensive S-Plus. It’s easy to install, has an excellent GUI on OS X, and has a ton of community released packages which are usually made during the preparation of scientific papers. There are some downsides, as there can be multiple (sometimes possibly conflicting) packages (e.g. gam vs mgcv) but choice is good, right? The cons for me are that it’s a new language to learn, and even though I write an m-script for everything, I find the scripting in R a bit clunky, even writing in TextWrangler and then hitting CTRL-R to have the SendToR script source the code for me. It’s just something new, and while the built in functions are really nice, the learning curve for coding things is higher, and will it be faster in the long run than just using Matlab?

Numpy/SciPy

The Numpy/SciPy combo in Python is a viable alternative to Matlab, even having a page dedicated to showing you how easy it is to transition from Matlab. As with R, it’s free, and there are a ton of functions available, but there is a downside for me. I’ve successfully installed it on CentOS 5.1 and OS X 10.5, but it was a bit complicated. I know that these are packaged in many distributions, but not in CentOS, and I had to install from either source or .egg files, which isn’t all that tough, but took some time. I’m not writing the 24.3 steps I did to get it installed because honestly, I didn’t write it down and I don’t remember what I did. Next time I promise to list it out! On OS X I did it all through MacPorts on the MP version of python 2.5. Again, it took some massaging to get it all set up since I was using the non-default install of python.

Overall though, the reason for this little diatribe is that while there are alternatives to Matlab, they all involve learning new ways to do things which, after I successfully learn them, may not be faster than just doing it in Matlab. Most of the time I just need to get things done, and the $7/day cost of Matlab may be well worth it if I’m saving more than 10 minutes of time during that day (assuming for a minute that I am earning $42/hour).

I’m rambling a bit here, but these are just questions that I ask myself as I code things up at the desk. For each of these tools has their place, and in terms of maximum comfort and speed, I use each of them for their strengths. The main dilemma is that in a perfect situation I would drop the commercial Matlab for the free/open source alternatives, but at a minimal cost in dollars and time.

Technorati Tags:
, , , , ,

In searching for a way to access OpenDAP data in Matlab I got to the Matlab Ocean Toolbox, which calls on the Loaddap backend. To get this running was pretty simple, although I went a bit backwards about it.

1. Compiling libdap-3.7.3 under CentOS 5.1
Basically there was an RPM for libdap that came with the Ocean Toolbox package, but I had already compiled the library from source. The only snag I hit was here during the make phase:

Vector.h:141: error: extra qualification ‘Vector::’ on member ‘value’
Vector.h:142: error: extra qualification ‘Vector::’ on member ‘value’
Vector.h:143: error: extra qualification ‘Vector::’ on member ‘value’
Vector.h:144: error: extra qualification ‘Vector::’ on member ‘value’
Vector.h:145: error: extra qualification ‘Vector::’ on member ‘value’
Vector.h:146: error: extra qualification ‘Vector::’ on member ‘value’
Vector.h:147: error: extra qualification ‘Vector::’ on member ‘value’
Vector.h:148: error: extra qualification ‘Vector::’ on member ‘value’

What I ended up doing was just to delete

Vector::

on all lines in the Vector.h file and it compiled. To get loaddap on there, I just did a simple

rpm -ivh –nodeps loaddap-3.6.0-1.i386.rpm

with the –nodeps switch to get rid of the matlab dependency issues. So far so good!

To install Matlab (2007b) on Fedora 8 you can just run the installer from the DVD.

1. Create /usr/local/Matlab2007b
2. sudo /media/MATLAB2007B/install &
3. /usr/local/Matlab2007b/etc/lmstart
4. sudo yum install libXp.i386
5. matlab &