<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Keeping Things Tidy</title>
	<atom:link href="http://blogs.mathworks.com/loren/2008/03/10/keeping-things-tidy/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.mathworks.com/loren/2008/03/10/keeping-things-tidy/</link>
	<description>Loren Shure works on design of the MATLAB language at MathWorks. She writes here about once a week on MATLAB programming and related topics.</description>
	<lastBuildDate>Thu, 09 Feb 2012 04:19:21 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Loren</title>
		<link>http://blogs.mathworks.com/loren/2008/03/10/keeping-things-tidy/#comment-32399</link>
		<dc:creator>Loren</dc:creator>
		<pubDate>Fri, 29 Jul 2011 10:51:51 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2008/03/10/keeping-things-tidy/#comment-32399</guid>
		<description>Flori-

That should work.  If you have a problem with it, please contact technical support - link at the right of this blog.

--Loren</description>
		<content:encoded><![CDATA[<p>Flori-</p>
<p>That should work.  If you have a problem with it, please contact technical support &#8211; link at the right of this blog.</p>
<p>&#8211;Loren</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Flori</title>
		<link>http://blogs.mathworks.com/loren/2008/03/10/keeping-things-tidy/#comment-32394</link>
		<dc:creator>Flori</dc:creator>
		<pubDate>Mon, 25 Jul 2011 17:44:12 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2008/03/10/keeping-things-tidy/#comment-32394</guid>
		<description>is it possible to use onCleanup to close an avifile using the command

aviobj = close(aviobj)

thanks</description>
		<content:encoded><![CDATA[<p>is it possible to use onCleanup to close an avifile using the command</p>
<p>aviobj = close(aviobj)</p>
<p>thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jiro</title>
		<link>http://blogs.mathworks.com/loren/2008/03/10/keeping-things-tidy/#comment-32360</link>
		<dc:creator>jiro</dc:creator>
		<pubDate>Tue, 05 Jul 2011 13:26:57 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2008/03/10/keeping-things-tidy/#comment-32360</guid>
		<description>@Ken,

I should have said to use &quot;ishandle&quot; to check to see if the handle to your GUI is a valid handle.</description>
		<content:encoded><![CDATA[<p>@Ken,</p>
<p>I should have said to use &#8220;ishandle&#8221; to check to see if the handle to your GUI is a valid handle.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jiro</title>
		<link>http://blogs.mathworks.com/loren/2008/03/10/keeping-things-tidy/#comment-32355</link>
		<dc:creator>jiro</dc:creator>
		<pubDate>Tue, 05 Jul 2011 12:13:31 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2008/03/10/keeping-things-tidy/#comment-32355</guid>
		<description>@Ken,

You can use &quot;isvalid&quot; to check to see if the handle of waitbar is valid before updating it.

If you want the closing of the waitbar to trigger something else, you can assign a &quot;DeleteFcn&quot; for your waitbar.</description>
		<content:encoded><![CDATA[<p>@Ken,</p>
<p>You can use &#8220;isvalid&#8221; to check to see if the handle of waitbar is valid before updating it.</p>
<p>If you want the closing of the waitbar to trigger something else, you can assign a &#8220;DeleteFcn&#8221; for your waitbar.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ken</title>
		<link>http://blogs.mathworks.com/loren/2008/03/10/keeping-things-tidy/#comment-32354</link>
		<dc:creator>Ken</dc:creator>
		<pubDate>Fri, 01 Jul 2011 17:39:43 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2008/03/10/keeping-things-tidy/#comment-32354</guid>
		<description>I am currently programming GUIs using Matlab. I would like to know if there is a way to detect when the user closes a GUI using the &quot;X&quot; in the top bar of the GUI window. I refer to this method of closing the GUI as a &quot;brute force&quot; close as opposed to closing the GUI via code using the close() or delete() commands, for example.

The reason I ask, is that I have a GUI with a pushbutton callback. The callback calls another function (FNCx) with a long execution time. Before calling FNCx, however, the callback launches another GUI (much like a waitbar display). The waitbar is updated from within the FNCx. If the user brute force closes the custom waitbar GUI it causes an error when FNCx attempts to update the waitbar because the handle of the waitbar GUI is no longer valid.

If there were a means to detect a brute force close it would help simplify my code.

Regards,
Ken</description>
		<content:encoded><![CDATA[<p>I am currently programming GUIs using Matlab. I would like to know if there is a way to detect when the user closes a GUI using the &#8220;X&#8221; in the top bar of the GUI window. I refer to this method of closing the GUI as a &#8220;brute force&#8221; close as opposed to closing the GUI via code using the close() or delete() commands, for example.</p>
<p>The reason I ask, is that I have a GUI with a pushbutton callback. The callback calls another function (FNCx) with a long execution time. Before calling FNCx, however, the callback launches another GUI (much like a waitbar display). The waitbar is updated from within the FNCx. If the user brute force closes the custom waitbar GUI it causes an error when FNCx attempts to update the waitbar because the handle of the waitbar GUI is no longer valid.</p>
<p>If there were a means to detect a brute force close it would help simplify my code.</p>
<p>Regards,<br />
Ken</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Loren</title>
		<link>http://blogs.mathworks.com/loren/2008/03/10/keeping-things-tidy/#comment-32154</link>
		<dc:creator>Loren</dc:creator>
		<pubDate>Mon, 28 Mar 2011 20:56:08 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2008/03/10/keeping-things-tidy/#comment-32154</guid>
		<description>Ross-

As far as I know, there is no way to change it.  There&#039;s an outside chance that there&#039;s a way to change the callback, but I don&#039;t know if that&#039;s possible, but if so, it should be in the documentation.  Unfortunately, I have no access to MATLAB at the moment.

--Loren</description>
		<content:encoded><![CDATA[<p>Ross-</p>
<p>As far as I know, there is no way to change it.  There&#8217;s an outside chance that there&#8217;s a way to change the callback, but I don&#8217;t know if that&#8217;s possible, but if so, it should be in the documentation.  Unfortunately, I have no access to MATLAB at the moment.</p>
<p>&#8211;Loren</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ross</title>
		<link>http://blogs.mathworks.com/loren/2008/03/10/keeping-things-tidy/#comment-32152</link>
		<dc:creator>Ross</dc:creator>
		<pubDate>Mon, 28 Mar 2011 17:11:22 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2008/03/10/keeping-things-tidy/#comment-32152</guid>
		<description>Hi Loren,

Is there a way to &quot;cancel&quot; an onCleanup object&#039;s task (i.e., delete the object without triggering its task)?</description>
		<content:encoded><![CDATA[<p>Hi Loren,</p>
<p>Is there a way to &#8220;cancel&#8221; an onCleanup object&#8217;s task (i.e., delete the object without triggering its task)?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Loren</title>
		<link>http://blogs.mathworks.com/loren/2008/03/10/keeping-things-tidy/#comment-31143</link>
		<dc:creator>Loren</dc:creator>
		<pubDate>Wed, 10 Mar 2010 18:19:40 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2008/03/10/keeping-things-tidy/#comment-31143</guid>
		<description>Paul-

MATLAB doesn&#039;t have any facility for handling Ctrl-C at the programming level that I know of.  I don&#039;t know why you don&#039;t want to use a function, but that solution would be my preferred one, for this, and probably a bunch of other reasons.

--Loren</description>
		<content:encoded><![CDATA[<p>Paul-</p>
<p>MATLAB doesn&#8217;t have any facility for handling Ctrl-C at the programming level that I know of.  I don&#8217;t know why you don&#8217;t want to use a function, but that solution would be my preferred one, for this, and probably a bunch of other reasons.</p>
<p>&#8211;Loren</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul</title>
		<link>http://blogs.mathworks.com/loren/2008/03/10/keeping-things-tidy/#comment-31142</link>
		<dc:creator>Paul</dc:creator>
		<pubDate>Wed, 10 Mar 2010 16:00:43 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2008/03/10/keeping-things-tidy/#comment-31142</guid>
		<description>Loren,

I know this is an old thread (exactly 2 years now that I think of it!), but I hope that you are still reading it.

I want to use something like onCleanup when a script m-file is aborted via Ctrl-C. My use case is that I have opened a number of Excel-workbooks as handles and write to them with a modified version of xlswrite (for speed considerations I don&#039;t want to use the regular xlswrite which opens/closes the workbooks every time). I want the workbooks to be closed when the program is aborted, but onCleanup isn&#039;t triggerd because the scripts variables don&#039;t go out of scope. Obviously I could wrap the whole program into a function but that is not really what I want. Can you think of any workarounds?

thank you
Paul</description>
		<content:encoded><![CDATA[<p>Loren,</p>
<p>I know this is an old thread (exactly 2 years now that I think of it!), but I hope that you are still reading it.</p>
<p>I want to use something like onCleanup when a script m-file is aborted via Ctrl-C. My use case is that I have opened a number of Excel-workbooks as handles and write to them with a modified version of xlswrite (for speed considerations I don&#8217;t want to use the regular xlswrite which opens/closes the workbooks every time). I want the workbooks to be closed when the program is aborted, but onCleanup isn&#8217;t triggerd because the scripts variables don&#8217;t go out of scope. Obviously I could wrap the whole program into a function but that is not really what I want. Can you think of any workarounds?</p>
<p>thank you<br />
Paul</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Loren</title>
		<link>http://blogs.mathworks.com/loren/2008/03/10/keeping-things-tidy/#comment-30169</link>
		<dc:creator>Loren</dc:creator>
		<pubDate>Wed, 01 Apr 2009 17:30:18 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2008/03/10/keeping-things-tidy/#comment-30169</guid>
		<description>Kieran-

A plain function handle could be fine in some cases, I think.  In any case, you can rewrite @func as @()func() if it really doesn&#039;t take any input.

--loren</description>
		<content:encoded><![CDATA[<p>Kieran-</p>
<p>A plain function handle could be fine in some cases, I think.  In any case, you can rewrite @func as @()func() if it really doesn&#8217;t take any input.</p>
<p>&#8211;loren</p>
]]></content:encoded>
	</item>
</channel>
</rss>

