views:

1454

answers:

5

After writing the code in Matlab, is it possible to compile it into libraries and distribute them to customers who don't have matlab without installing the whole Matlab program? What is the license governing the distribution of Matlab code?

A: 

From what I've learned at a recent Matlab training session, you can build your Matlab code into an exe, and distribute that along with the necessary library for free. But you should check with a Matlab representative to make sure, and verify the legal implications.

Kena
+1  A: 

You can compile matlab code into a stand-alone executable. What you get is the matlab interpreter and your functions wrapped into an executable program. You would not get any speedup though, since your matlab code would still be interpreted. As far as I know, there should not be any licensing issues with Mathworks here, since your customers would not be able to add or modify any matlab code inside this executable.

Dima
+7  A: 

According to Matlab Support:

MATLAB® deployment products convert MATLAB programs into applications and components that you can distribute to end users who do not have MATLAB installed. Deployed applications run as M-code against a set of supporting MATLAB libraries called the MATLAB Component Runtime (MCR). The deployment products generate wrapper code to allow your MATLAB application to run as a stand-alone executable or interact with other technologies, but your application remains in M-code. Thus, the execution time of deployed code will be almost identical to the execution time in MATLAB.

You can deploy MATLAB applications as:

* Stand-alone executables using MATLAB Compiler™
* C or C++ libraries using MATLAB Compiler™
* Java classes using MATLAB Builder™ JA
* Microsoft .NET or COM components using MATLAB Builder™ NE
* Microsoft Excel add-ins using MATLAB Builder™ EX

All deployed components and applications can be distributed free of charge. The deployment products support the MATLAB language, most MATLAB toolboxes, and user-developed GUIs.

Adam Davis
A: 

The application deployment products allow you to compile and distribute your M code in a variety of different ways:

http://www.mathworks.com/applications/tech_computing/description/progapp.html

The MATLAB Compiler allows you to redistribute your application or library royalty free. You will need to distribute the MATLAB Compiler Runtime with your target component. This is provided with the Compiler product.

Todd
A: 

Just note there are certain functions that will not work for compiled apps. "eval" is the obvious one (otherwise you could create your own MATLAB shell), however there are others.

Jason S

related questions