views:

82

answers:

2

Hi,

I have some Matlab code and a GUI for it and I want to make a standalone .exe so that it can be used on computers that don't have Matlab installed.

I know about the Matlab compiler and how to use it, but that creates an .exe that only works if the user has the MATLAB Compiler Run-Time (MCR) installed.

What I'm interested in, is if there are any ways to create a standalone .exe that still uses the Matlab code but does not depend on the MCR. I want it to just run when you click it without needing anything else installed.

I know C can make use of Matlab, is there any way to use the code with C? How about any open source Matlab alternatives that can it?

As a last resort, if I were to rewrite the Matlab code in another language, what language would you recommend? I was thinking C or Python.

Thanks.

+1  A: 

I have researched a bit, and I am afraid that your only option is either using the MCR, or converting your code into another language. It makes sense that MathWorks would want you to use only their compiler in order to create .exe files.

Onsider another language only if you are already familiar with them, and/or you have enough time for what you are trying to accomplish. Furthermore, if you are using functions in MatLab that you didn't write, then you will have to write those also, which may be very hard/impossible.

If none of the above is a problem, then what language you should use is really up to you. You are not just limited to C and Python. MatLab, im my opinion, is very much like other common languages, at least in terms of syntax. You will have to do some learning eitherway, so I would suggest that you either go with a language you know, or pick a language for which finding help is easy. C#, Java are two of the more 'famous' languages.

sbenderli
Yeah, it was just wishful thinking. The MCR is free though, so it's not a big deal; just an annoyance for users. I'm not honestly considering rewriting the code. Like I said, it's just a last resort (and I'll probably just make up an excuse before I have to resort to it >_>).
bloots
excellent plan :D
sbenderli
A: 

It's been a while since I looked at the MATLAB compiler but if I remember correctly it used to be able to generate C/C++ code rather than going all-out and generating an executable. The hangup was always in which toolboxes your code used and whether the compiler supported them or not. Any chance you could install the MATLAB application on a server and have a desktop client phone in for results?

As far as other languages go, I'd check out NumPy and SciPy in combination with matplotlib (matplotlib.sf.net). I'm working with a MATLAB developer right now and so far he's pretty pleased with the experience.

ChrisC
"Any chance you could install the MATLAB application on a server and have a desktop client phone in for results" -- this is probably too much work for my purposes. I was just curious if there was something more convenient than installing the MCR. Most people I know tend to hate installing something just to run one little application. Thanks for your suggestion of NumPy and matplotlib though. I will keep these in mind.
bloots

related questions