Beruflich Dokumente
Kultur Dokumente
Onecore
Developer Network
Home
About
Advertise
Archives
Fortran To C Migration
All Popular Fortran Dialects Extremely Accurate and Complete
www.prom ula.com
The code you write is stored within the .m file.During demonstrations,if you want to mask the code,all you
need to do is to create executable file from it.With such standalone executable,you can even show your work
on computer that have no matlab environment in it.Here,i’ll explain how to create such standalone
application.We’ll start with creating simple program then move onto configuring the compiler environment.
Code:
we’ll write simple program that uses plot function to draw the 2-d graph of two varibales.
function graph
a=[12,54,33,80,26];
b=[44,25,72,98,66];
plot(a,b);
Code explaination
Let’s explore the code line by line.First i’ve written the function name “graph” same as that of filename such
that there won’t be any conflict for compiler.Next two line creates a variables with multiple values.At the
end,plot function is called to plot the graph of two variables a & b.
onecore.net/howtocreate-standalone-… 1/4
05-10-2010 HowTO:Create standalone executable…
Compiler configuration
First thing we need to do is configure the compiler.In the command prompt of the matlab,type
mbuild -setup
Type ,”Y” to answer this question.This will force the interpreter to display the list of compilers.e.g.The list
shown below.Then it will ask for the choice for the compiler,answer in format 1,2 or 0 for none.
Select a compiler:
[1] Borland C++Builder version 6.0 in D:\Program Files\Borland
[2] Lcc C version 2.4.1 in D:\MATLAB71\sys\lcc
[0] None
Compiler: 1
I have selected the Borland C++ builder,if you have other option then choose approproate compiler
otherwise,you can select the LCC C compiler.Then it will ask you to verify the source.
Done . . .
Compilation
Once the compiler configuration is done,now you have to compile the program source code.Type the
following line in the interpreter.
Interpreter will create the necessary linker files for the MAT file,once the process is completed you can see
the standalone executable is created for the compiler.When you click on it,that will open the command line
window & the graphical plot of your program.
I hope above information helps. This tutorial was tested with Matlab 7.1 . So for support of higher
version, you should check out the Mathworks support & Forums.
onecore.net/howtocreate-standalone-… 2/4
05-10-2010 HowTO:Create standalone executable…
Related posts:
Comments
1. Alfia says:
April 1, 2007 at 11:58 am
Hey! Hi… Just wanted to thank you so much for that little help note… It was of immense help at the
last minute.
THANK YOU SO MUCH.
Great job!
2. Dan says:
April 2, 2007 at 2:15 am
3. RAJKIRAN.S.N says:
April 24, 2007 at 4:48 am
Featured Articles
onecore.net/howtocreate-standalone-… 3/4
05-10-2010 HowTO:Create standalone executable…
Java Graph Library
Create Impressive Graphs and Charts Fast
3D Engine. Free Download
www.bfo.co.uk /graphlibrary
HCS12X & Xgate Dev Tools
Compiler, BDM Debug, Flash Program and
simulator for Freescale Micros
www.cosm ic-software .com
C++ Database
High Scalability, High Availability Large Data
Sets, High Performance
www.ve rsant.com /obje ctdatabase
ASN.1 CDR Tools
ASN.1 CDR compiler to C/C++/Java Full
XML/ASCII support. Free eval.
www.oss.com
© 2010Onecore
onecore.net/howtocreate-standalone-… 4/4