Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to make matlab m-file executable?

Status
Not open for further replies.
Yes of course,

you can use the MATLAB Compiler to make Stand-Alone Applications and here is a hint about how it works, I hope its enough for you.


The MATLAB Compiler, when invoked with the -m macro option, takes the input M-files and produces the required wrapper file suitable for a stand-alone application. Then, your C or C++ compiler compiles this code and links against the MCR, which is a stand-alone set of shared libraries that enable the execution of M-files. For example, to generate a stand-alone executable from the file example.m, use

Code:
[size=18]mcc -m example[/size]
where: mcc is the compliling command in MATLAB
-m is the macro option ( telling the compiler that it is .m file to be compiled)
example is the name of the .m file as you saved it.

Godd luck.

Added after 1 minutes:

Yes of course,

you can use the MATLAB Compiler to make Stand-Alone Applications and here is a hint about how it works, I hope its enough for you.


The MATLAB Compiler, when invoked with the -m macro option, takes the input M-files and produces the required wrapper file suitable for a stand-alone application. Then, your C or C++ compiler compiles this code and links against the MCR, which is a stand-alone set of shared libraries that enable the execution of M-files. For example, to generate a stand-alone executable from the file example.m, use

Code:
[size=18]mcc -m example[/size]
where: mcc is the compliling command in MATLAB
-m is the macro option ( telling the compiler that it is .m file to be compiled)
example is the name of the .m file as you saved it.

Godd luck.
 
Very Good, Thank you very much for this wonderful information, Two more questions;

1.) I have not seen what filename should be use for the executable file. Is this automatically generated or I need to tell matlab what should be its filename? and how should I do it?

2.) What folder does the executable file is in?

I'll try this at home this night.
Thanks,
Jack
 

Dear Jack,

as shown in the command you give as a parameter the .m filename and it matlab creates the executable files in the same folder where the .m file is in and by the same name of the original .m filename.

Hope I've had helped enough.

Karim
 
it is easy to ask it from matlab itself by
help mcc
and you'll get:
Make stand-alone C executable for myfun.m. Look for myfun.m in the directory /files/source, and put the resulting C files and executable in directory /files/target:
mcc -m -I /files/source -d /files/target myfun
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top