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:
Standalone compiled app and .fig files?

Subject: Standalone compiled app and .fig files?

From: caio guimaraes

Date: 24 Jan, 2008 13:06:02

Message: 1 of 5

Hello,
I?m a beginner in Matlab, and I just started learning about
the mcc compiler. I have a .m program that generates a .fig
file (like a graph) and I?d like to make a standalone
application of it using mcc compiler.

I compiled -mcc program.m and the application runs
normally, only the pictures plots on screen and closes real
fast.. Where did the picture go? Is there a way to save it
somewhere, does it open anywhere?

Help!
Thanks!

Subject: Standalone compiled app and .fig files?

From: caio guimaraes

Date: 24 Jan, 2008 15:43:03

Message: 2 of 5

anybody?
I think it?s an easy problem.. but I don?t know how to
solve it.


"caio guimaraes" <caioaer@hotmail.com> wrote in message
<fna2fq$dtu$1@fred.mathworks.com>...
> Hello,
> I?m a beginner in Matlab, and I just started learning
about
> the mcc compiler. I have a .m program that generates
a .fig
> file (like a graph) and I?d like to make a standalone
> application of it using mcc compiler.
>
> I compiled -mcc program.m and the application runs
> normally, only the pictures plots on screen and closes
real
> fast.. Where did the picture go? Is there a way to save
it
> somewhere, does it open anywhere?
>
> Help!
> Thanks!

Subject: Standalone compiled app and .fig files?

From: Steven Lord

Date: 24 Jan, 2008 18:14:44

Message: 3 of 5


"caio guimaraes" <caioaer@hotmail.com> wrote in message
news:fnabm7$ee8$1@fred.mathworks.com...
> anybody?
> I think it?s an easy problem.. but I don?t know how to
> solve it.
>
>
> "caio guimaraes" <caioaer@hotmail.com> wrote in message
> <fna2fq$dtu$1@fred.mathworks.com>...
>> Hello,
>> I?m a beginner in Matlab, and I just started learning
> about
>> the mcc compiler. I have a .m program that generates
> a .fig
>> file (like a graph) and I?d like to make a standalone
>> application of it using mcc compiler.
>>
>> I compiled -mcc program.m and the application runs
>> normally, only the pictures plots on screen and closes
> real
>> fast.. Where did the picture go? Is there a way to save
> it
>> somewhere, does it open anywhere?

I'm not an expert with the MATLAB Compiler, but my guess is that the
behavior you're seeing is the normal exit process for an application
compiled with the Compiler. When the application exits, it has to clean up
after itself -- this includes closing any figure windows that it opened (if
it didn't, that would be a resource leak and that would be a Bad Thing.)

Try using SAVEAS, PRINT, or IMWRITE to send the figure to a printer or file
before your application exits, or try using PAUSE, UIWAIT, or WAITFOR to
force your application to stay open until a certain amount of time has
passed or the figures have closed.

--
Steve Lord
slord@mathworks.com

Subject: Standalone compiled app and .fig files?

From: caio guimaraes

Date: 25 Jan, 2008 09:59:02

Message: 4 of 5

I also think this is the problem. The application forcely
closes at the end of its running process.

But I have tried the saveas function, and the pause,
waitfor solutions. But none of them work.

They do work if I run the program from matlab before
compiling. But after the application is compiled and I run
from the .exe file, it still closes..



"Steven Lord" <slord@mathworks.com> wrote in message
<fnakik$7e2$1@fred.mathworks.com>...
>
> "caio guimaraes" <caioaer@hotmail.com> wrote in message
> news:fnabm7$ee8$1@fred.mathworks.com...
> > anybody?
> > I think it?s an easy problem.. but I don?t know how to
> > solve it.
> >
> >
> > "caio guimaraes" <caioaer@hotmail.com> wrote in message
> > <fna2fq$dtu$1@fred.mathworks.com>...
> >> Hello,
> >> I?m a beginner in Matlab, and I just started learning
> > about
> >> the mcc compiler. I have a .m program that generates
> > a .fig
> >> file (like a graph) and I?d like to make a standalone
> >> application of it using mcc compiler.
> >>
> >> I compiled -mcc program.m and the application runs
> >> normally, only the pictures plots on screen and closes
> > real
> >> fast.. Where did the picture go? Is there a way to save
> > it
> >> somewhere, does it open anywhere?
>
> I'm not an expert with the MATLAB Compiler, but my guess
is that the
> behavior you're seeing is the normal exit process for an
application
> compiled with the Compiler. When the application exits,
it has to clean up
> after itself -- this includes closing any figure windows
that it opened (if
> it didn't, that would be a resource leak and that would
be a Bad Thing.)
>
> Try using SAVEAS, PRINT, or IMWRITE to send the figure to
a printer or file
> before your application exits, or try using PAUSE,
UIWAIT, or WAITFOR to
> force your application to stay open until a certain
amount of time has
> passed or the figures have closed.
>
> --
> Steve Lord
> slord@mathworks.com
>
>

Subject: Standalone compiled app and .fig files?

From: Vikram

Date: 30 Mar, 2008 11:49:01

Message: 5 of 5

"caio guimaraes" <caioaer@hotmail.com> wrote in message
<fna2fq$dtu$1@fred.mathworks.com>...
> Hello,
> I?m a beginner in Matlab, and I just started learning about
> the mcc compiler. I have a .m program that generates a .fig
> file (like a graph) and I?d like to make a standalone
> application of it using mcc compiler.
>
> I compiled -mcc program.m and the application runs
> normally, only the pictures plots on screen and closes real
> fast.. Where did the picture go? Is there a way to save it
> somewhere, does it open anywhere?
>
> Help!
> Thanks!

Hi, it's very simple, at the end of all matlab code in your
main function, use the 'pause' keyword to keep the
application open.

Tags for this Thread

No tags are associated with 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