Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
How I can generate *.exe from .m, .fig, .mdl ?

Subject: How I can generate *.exe from .m, .fig, .mdl ?

From: Kirill

Date: 12 Apr, 2009 14:38:01

Message: 1 of 7

Hi, All.

My programm consists of *.fig-, *.m- and *.mdl-files. Can I make stand-alone executable file from these files? And if I can, what is necessary for this?
It's interesting that there are the same topics, but I cannot find an answer.

Best regards.

Subject: How I can generate *.exe from .m, .fig, .mdl ?

From: Nasser Abbasi

Date: 12 Apr, 2009 15:28:39

Message: 2 of 7


"Kirill " <ksporyagin@mail.ru> wrote in message
news:grsuc9$3mc$1@fred.mathworks.com...
> Hi, All.
>
> My programm consists of *.fig-, *.m- and *.mdl-files. Can I make
> stand-alone executable file from these files? And if I can, what is
> necessary for this?
> It's interesting that there are the same topics, but I cannot find an
> answer.
>
> Best regards.

Do not know about mdl's, but have you tried searching for "matlab compiler"?

There are only 207,000 hits on google, and the first one that comes up looks
promising.

Results 1 - 10 of about 207,000 for matlab compiler. (0.29 seconds)

--Nasser

Subject: How I can generate *.exe from .m, .fig, .mdl ?

From: Phil Goddard

Date: 12 Apr, 2009 16:20:01

Message: 3 of 7

"Kirill " <ksporyagin@mail.ru> wrote in message <grsuc9$3mc$1@fred.mathworks.com>...
> Hi, All.
>
> My programm consists of *.fig-, *.m- and *.mdl-files. Can I make stand-alone executable file from these files? And if I can, what is necessary for this?
> It's interesting that there are the same topics, but I cannot find an answer.
>
> Best regards.

fig and m files (and other purely MATLAB and Toolbox functionality) can be converted to a standalone app using a product called the "MATLAB Compiler".
However, the MATLAB Compiler does _not_ support _any_ Simulink (or Blockset) functionality.
The mechanism to convert a Simulink model to standalone code is the product called "Real-Time Workshop" (or RTW for short).
Unfortunately there is no single/simple method to convert a combined MATLAB and Simulink application to a standalone application.

You can however use the following process:
1. Convert your Simulink model to a standalone exe using the RSIM target of RTW
2. Rewrite your UI to use the appropriate MATLAB functions for manipulating the RSIM generated exe (which with a little work allows you to run the model, tune parameters, and retrieve resulting data).
3. Use the MATLAB Compiler to convert the UI created in step 2 to a standalone exe.

You then have 2 exe's that can work with each other.
I have done this in the past with some success, although it is a little tedious.
I'm not sure if there are any examples showing how to do it, but you might search the File Exchange to see.

If you're not familiar with any of the above terms then go the mathworks.com and do a search, then read the doc.

Phil.

Subject: How I can generate *.exe from .m, .fig, .mdl ?

From: Kirill

Date: 12 Apr, 2009 16:47:01

Message: 4 of 7

Thanks for answers!
Of course I know about MatLab compiler, I read all MatLab help about it. But anywhere I cannot find explicit instructions what have I do if I have to compile .mdl and .m-file together.
Thanks for your method, Phil, I will try.

May bee there are some methods more?

Will be glad for any ideas!

Subject: How I can generate *.exe from .m, .fig, .mdl ?

From: gourish

Date: 24 Apr, 2009 14:55:05

Message: 5 of 7

"Kirill " <ksporyagin@mail.ru> wrote in message <grsuc9$3mc$1@fred.mathworks.com>...
> Hi, All.
>
> My programm consists of *.fig-, *.m- and *.mdl-files. Can I make stand-alone executable file from these files? And if I can, what is necessary for this?
> It's interesting that there are the same topics, but I cannot find an answer.
>
> Best regards.

Subject: How I can generate *.exe from .m, .fig, .mdl ?

From: gourish

Date: 24 Apr, 2009 14:55:05

Message: 6 of 7

"Kirill " <ksporyagin@mail.ru> wrote in message <grsuc9$3mc$1@fred.mathworks.com>...
> Hi, All.
>
> My programm consists of *.fig-, *.m- and *.mdl-files. Can I make stand-alone executable file from these files? And if I can, what is necessary for this?
> It's interesting that there are the same topics, but I cannot find an answer.
>
> Best regards.

Subject: How I can generate *.exe from .m, .fig, .mdl ?

From: Arnaud Miege

Date: 24 Apr, 2009 15:00:23

Message: 7 of 7


"Kirill " <ksporyagin@mail.ru> wrote in message
news:grt5u5$3c8$1@fred.mathworks.com...
> Thanks for answers!
> Of course I know about MatLab compiler, I read all MatLab help about it.
> But anywhere I cannot find explicit instructions what have I do if I have
> to compile .mdl and .m-file together.
> Thanks for your method, Phil, I will try.
>
> May bee there are some methods more?
>
> Will be glad for any ideas!

Phil's suggestion is correct. Have a look at the following technical
solution on The MathWorks web site:
http://www.mathworks.com/support/solutions/data/1-27DUK5.html

HTH,

Arnaud

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us