Question

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

Was it helpful?

Solution

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.

OTHER TIPS

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.

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.

If you can afford to lose some of Matlab's more powerful proprietary features, there are several open-source numerical computation engines that use syntax mostly compatible with that of Matlab. One of the most mature of these is GNU Octave.

There are several examples of online Octave interfaces. Octave Online is a new interface that supports a live prompt and an online editor. I am a member of the team developing Octave Online. You can find more examples of online Octave interfaces on the Octave wiki. The Octave mailing list is a good resource for prior online Octave projects.

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top