Is there an easy way to provide a Matlab-based Web App or Web Service?
Asked Answered
P

5

12

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

Propylene answered 26/11, 2008 at 20:57 Comment(0)
W
7

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.

Willpower answered 27/11, 2008 at 0:42 Comment(3)
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--plPropylene
You are welcome :) Are you going to make your application public?Willpower
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.Propylene
G
3

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.

Goggin answered 26/11, 2008 at 21:3 Comment(2)
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.Bremble
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.Toothed
L
3

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.

Lockage answered 15/12, 2008 at 17:37 Comment(0)
U
3

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.

Unfleshly answered 4/7, 2013 at 22:55 Comment(0)
O
1

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.

Orthopedic answered 15/11, 2009 at 12:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.