Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

What's the difference between the two?

As far as I understand it, MATLAB Compiler wraps the MATLAB code into a .exe file so that it can be used without installing MATLAB, and only requires the MCR. On top of it MATLAB Builder NE can also be used to produce .Net assemblies to be used with .Net framework instead of the .exe file, but they still require MCR.

Now I don't understand what MATLAB Coder used for? It generates C/C++ code. But is the MATLAB code really converted into C/C++, or is it merely packaged like in the case of MATLAB Compiler? Does it also need the MCR to run?

I understand that this is not exactly a programming question. But I have searched the internet and still haven't found a clear answer. These are very expensive products so I would like to know what I am getting into.

share|improve this question
2  
This question would be a perfect opportunity for users to update and edit the tag wikis for matlab-coder and matlab-compiler. The latter appears to be generic and specific to Matlab itself. –  horchler Aug 8 '13 at 16:01
1  
@horchler Good point, I have edited the matlab-compiler tag. They are both still a bit concise, but I don't have anything better. –  Dennis Jaheruddin Aug 14 '13 at 14:05

2 Answers 2

up vote 17 down vote accepted

MATLAB Compiler encrypts and archives your MATLAB code (which remains as MATLAB .m code), and packages it in a thin executable (either .exe or .dll) wrapper. This is delivered to the end user along with the MATLAB Compiler Runtime (MCR). If you wish, the MCR can be packaged within the executable as well.

The MCR is freely redistributable, and you can think of it as essentially a copy of MATLAB without a front-end desktop.

When the user runs the executable, it dearchives and decrypts the MATLAB code, and runs it against the MCR instead of MATLAB. Applications delivered via this method should therefore run exactly the same as they do within MATLAB (including the same speed).

MATLAB Coder converts a subset of the MATLAB language into C code. This can then be used in many different ways, including being brought back into MATLAB as a mex file, compiled with a C compiler to be called from another application, or delivered to an embedded device. Since it is C code rather than MATLAB code, it will often (though not always) run much faster than the original MATLAB code. The C code does not require the MCR. The supported subset of the MATLAB language is very extensive, but there are a few notable restrictions that you would want to look into before committing to this workflow. The code produced is C code, although it can produce a C++ wrapper if you have a need to use a C++ compiler rather than a C compiler.

MATLAB Compiler is intended for the use case that you want to simply and (fairly) straightforwardly share a MATLAB application that you've written with someone who does not have a copy of MATLAB. Since the deployed .m code is encrypted, it can also be used to share MATLAB code while protecting intellectual property.

MATLAB Coder has other use cases, such as wanting to speed up MATLAB code by converting to a mex file, or needing to produce C code for another application or an embedded device.

If you have more detailed questions, I would really recommend that you just call up MathWorks and ask them.

share|improve this answer

I'm not an expert, but the Coder is described as generating standalone C/C++ code, making no mention of the MCR. I notice however that it says that it only supports a "subset" of the Matlab language, which you can read more about here. The Compiler appears to just package up your Matlab code as you suggested, so probably supports most features.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.