views:

1175

answers:

5

A colleague and I have spent a few years developing a really cool Matlab application, MDLcompress. Within Matlab, I can type "MDLcompress('filename.txt')" and it will tell me all sorts of really cool stuff about the contents of filename.txt. We'd like to allow other people to use MDLcompress without downloading the code, installing Matlab, etc. Ideally, we'd have a simple web page where they selected a file from their machine, it got uploaded to my workstation (which is already running tomcat for other purposes, if that makes things easier), kicked off a process along the lines of "matlab < MDLcompress.m filename.txt > results.txt" and then displayed results.txt in their browser or showed a link to let them download it.

Trouble is, my Matlab skills far exceed my web skills. Google has 100 generic tutorials, but nothing as simple as I want, at least not specific to Matlab.

Thanks in advance

+1  A: 

A possible way is to compile the matlab code into C, and then make the C file into an apache module, and use an apache server. I have no idea how complicated this is, but it may work.

Yuval F
Well once its compiled to c, theres nerly infinite possibilities as to how to run it from a web page. The best way i guess in the current case would be to use php or python and execute the c app from that code.
Loki
This is definitely the way to go. Matlab files can be compiled into programs, then you can link the program into tomcat or apache. That part is beyond me, but It shouldn't a real problem.
Karl
+2  A: 

If you are mostly proficient in MATLAB you can write web application in MATLAB with MATLAB Web Server Edit: Matlab Web Server is discontinued, so it is not for you if you use recent version of Matlab. May be this tutorial will help to create CGI module from Matlab code.

Anton Nazarov
The tutorial you linked to is almost exactly what I was looking for. Now I just need to figure out how to make CGI work, but there's lots of stuff online for doing that.Thanks--pl
PlexLuthor
You are welcome :)Are you going to make your application public?
Anton Nazarov
As for making it public, probably not for a while. I work for a big huge corporation, and they let me publish the algorithm in pseudo-code, but not make it available, even for sale.
PlexLuthor
+1  A: 

Based on the tags, I assume you're trying to deploy to Tomcat or similar. The most straightforward way to do this is to use MATLAB Builder JA to create a Java wrapper for your code, then use the standard tools to deploy the Java as a web service.

Matthew Simoneau
A: 

PlexLuthor: sorry for using a public answer: I'm interested in MDLCompress and would like to test it on some files. Is there a public interface available? If not, any possibility of getting access to it? If you could contact me, I would really appreciate it. My email address is mgalle-irisa*fr (replace the - by @ and the * by .)

Thanks in advance,

A: 

We have developed a toolbox called Modelit Webserver Toolbox that should allow you to do this. We use this ourselves to run a Routing algorithm implemented in Matlab for an online route planner (the link is on our website). You can use the toolbox in conjunction with Tomcat and Matlab (2006b and up) or a compiled Matlab executable. The toolbox also provides a mechanism to run several jobs in parallel.

www.modelit.nl