HOWTO: Call Matlab from Java {Kinda}

July 12, 2007

Looking over some of the reports on my blog reveal that pretty much everyone to this point looking at this blog look at the Java / Matlab post and not much else. Therefore, here’s everything I’ve learned concretely on how to call Matlab from Java and what NOT to do to save you some grief:

What I did:
Make a file that contains all the commands you want to run when MATLAB starts. My script file looks like this (named scriptName):

cd /directoryWithMATLABScript/

The Java code I have used is a modified version of the code here. Now, use the following Java code to call MATLAB with the commands from your script:
Read the rest of this entry »


Calling Matlab from Java: Now 20% Less Painful!

June 6, 2007

UPDATE: The follow-up to this article can be found here.

Normally I’m not one to rant about programming or computer science stuff here (despite that degree I have in it), as I like to keep this more about philosophical crap (which I don’t have a degree in). However, I’ve spent quite a while on a research project and had a couple problems that all boil down to one thing: Matlab’s Java interface sucks. Bad.

If you don’t care for Computer Science stuff or when someone says “Java”, you think “Coffee”, this probably isn’t for you. In fact, it’s probably only really for me to bitch about randomly since I’ve wasted so much time on this.
Read the rest of this entry »