Reputation: 41
My m file is:
x=0:0.01:2*pi;
y=sin(x);
plot(x,y)
I want build this program by .exe format. I want run this .exe in a computer that doesn't have matlab.
Upvotes: 4
Views: 597
Reputation: 5982
There is a fully functional option: If you use a GUI file (such as myExample.fig, to put your visual components), and a .m file to put your code (such as myExample.m), you can compile it with Matlab Compiler, with just one line:
mcc -m myExample.m myExample.fig
A .exe is generated. You could use this .exe in any Windows computer, without any need of having a Matlab license (you only have to install a MCRInstaller - you could obtain it from your Matlab installation directory: [MATLAB]\R2010a\toolbox\compiler\deploy\win32\ - , that is free to distribute and requires no license).
http://www.mathworks.es/help/toolbox/compiler/mcc.html
Upvotes: 0
Reputation: 3037
The Matlab compiler is included for free within the base Matlab installation, no additional licenses are necessary.
The deploytool command provides a visual user interface for setting up options.
doc deploytool %# Launches help file browser for deploytool.
Alternatively, you can write a programmatic compilation script using the mcc command.
doc mcc % #Launch help file browser for mcc compiler.
Upvotes: 1
Reputation: 45
As mentioned by Marcelo there is no free solution for your exact problem.
But for your very simple program you could for example use Python with matplotlib to solve the problem and to generate an executable (you will have to include some python dlls as well). It will absolutely suffice and won't be significantly harder to write for your tiny program.
Upvotes: 2