From: andrea on
Hello,

to close directly a figure in MATLAB I click on the close button.
How can I catch this event? That is, what must I write to catch this event?


Thanks

Andrea
From: us on
"andrea " <nacchio1983(a)yahoo.it> wrote in message <i09p3g$ium$1(a)fred.mathworks.com>...
> Hello,
>
> to close directly a figure in MATLAB I click on the close button.
> How can I catch this event? That is, what must I write to catch this event?
>
>
> Thanks
>
> Andrea

a hint:
- some techniques are discussed in this thread...

http://www.mathworks.com/matlabcentral/newsreader/view_thread/278010#731436

us
From: Steven Lord on

"andrea " <nacchio1983(a)yahoo.it> wrote in message
news:i09p3g$ium$1(a)fred.mathworks.com...
> Hello,
>
> to close directly a figure in MATLAB I click on the close button.

That's _one_ way to close a figure, but it's not the _only_ way. [And
before you ask, I don't believe there's a way to determine _why_ the figure
is trying to close.]

> How can I catch this event? That is, what must I write to catch this
> event?

SET the figure's CloseRequestFcn property.

http://www.mathworks.com/access/helpdesk/help/techdoc/ref/figure_props.html#CloseRequestFcn

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com